Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / honnef.co / go / tools@v0.0.1-2020.1.5 / internal / passes / buildir / buildir_test.go
1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package buildir_test
6
7 import (
8         "fmt"
9         "os"
10         "testing"
11
12         "golang.org/x/tools/go/analysis/analysistest"
13         "honnef.co/go/tools/internal/passes/buildir"
14 )
15
16 func Test(t *testing.T) {
17         testdata := analysistest.TestData()
18         result := analysistest.Run(t, testdata, buildir.Analyzer, "a")[0].Result
19
20         irinfo := result.(*buildir.IR)
21         got := fmt.Sprint(irinfo.SrcFuncs)
22         want := `[a.init a.Fib (a.T).fib]`
23         if got != want {
24                 t.Errorf("IR.SrcFuncs = %s, want %s", got, want)
25                 for _, f := range irinfo.SrcFuncs {
26                         f.WriteTo(os.Stderr)
27                 }
28         }
29 }