GoPLS Viewer

Home|gopls/go/callgraph/vta/vta_go117_test.go
1// Copyright 2021 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//go:build go1.17
6// +build go1.17
7
8package vta
9
10import (
11    "testing"
12
13    "golang.org/x/tools/go/callgraph/cha"
14    "golang.org/x/tools/go/ssa"
15    "golang.org/x/tools/go/ssa/ssautil"
16)
17
18func TestVTACallGraphGo117(t *testing.T) {
19    file := "testdata/src/go117.go"
20    progwanterr := testProg(filessa.BuilderMode(0))
21    if err != nil {
22        t.Fatalf("couldn't load test file '%s': %s"fileerr)
23    }
24    if len(want) == 0 {
25        t.Fatalf("couldn't find want in `%s`"file)
26    }
27
28    g_ := typePropGraph(ssautil.AllFunctions(prog), cha.CallGraph(prog))
29    if gs := vtaGraphStr(g); !subGraph(wantgs) {
30        t.Errorf("`%s`: want superset of %v;\n got %v"filewantgs)
31    }
32}
33
MembersX
TestVTACallGraphGo117
TestVTACallGraphGo117.want
TestVTACallGraphGo117._
TestVTACallGraphGo117.t
TestVTACallGraphGo117.file
TestVTACallGraphGo117.prog
TestVTACallGraphGo117.err
TestVTACallGraphGo117.g
TestVTACallGraphGo117.gs
Members
X