Debian Codegraph @

format/format_test.go

raw symbols SCIP
1 // Copyright (c) 2021, Daniel Martí <[email protected]>
2 // See LICENSE for licensing information
3
4 package format_test
5
6 import (
7 "testing"
8
9 qt "github.com/frankban/quicktest"
10
11 "mvdan.cc/gofumpt/format"
12 )
13
14 func TestSourceIncludesSimplify(t *testing.T) {
15 t.Parallel()
16
17 in := []byte(`
18 package p
19
20 var ()
21
22 func f() {
23 for _ = range v {
24 }
25 }
26 `[1:])
27 want := []byte(`
28 package p
29
30 func f() {
31 for range v {
32 }
33 }
34 `[1:])
35 got, err := format.Source(in, format.Options{})
36 qt.Assert(t, err, qt.IsNil)
37 qt.Assert(t, string(got), qt.Equals, string(want))
38 }