Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / coc-go-data / tools / pkg / mod / golang.org / x / tools@v0.0.0-20201028153306-37f0764111ff / go / analysis / passes / buildssa / buildssa_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 buildssa_test
6
7 import (
8         "fmt"
9         "os"
10         "testing"
11
12         "golang.org/x/tools/go/analysis/analysistest"
13         "golang.org/x/tools/go/analysis/passes/buildssa"
14 )
15
16 func Test(t *testing.T) {
17         testdata := analysistest.TestData()
18         result := analysistest.Run(t, testdata, buildssa.Analyzer, "a")[0].Result
19
20         ssainfo := result.(*buildssa.SSA)
21         got := fmt.Sprint(ssainfo.SrcFuncs)
22         want := `[a.Fib (a.T).fib]`
23         if got != want {
24                 t.Errorf("SSA.SrcFuncs = %s, want %s", got, want)
25                 for _, f := range ssainfo.SrcFuncs {
26                         f.WriteTo(os.Stderr)
27                 }
28         }
29 }