go/types: remove surplus (obsolete) lines from test expectation.
Also add assertion that there are no surplus lines. LGTM=gri R=gri CC=golang-codereviews https://golang.org/cl/151890043
This commit is contained in:
parent
0e613cdb27
commit
4fd305d5dc
|
@ -719,12 +719,7 @@ func main() {
|
||||||
_ = (*B).f
|
_ = (*B).f
|
||||||
}`
|
}`
|
||||||
|
|
||||||
// TODO(adonovan): assert all map entries are used at least once.
|
|
||||||
wantOut := map[string][2]string{
|
wantOut := map[string][2]string{
|
||||||
"lib.T": {"qualified ident type lib.T float64", ".[]"},
|
|
||||||
"lib.C": {"qualified ident const lib.C lib.T", ".[]"},
|
|
||||||
"lib.F": {"qualified ident func lib.F()", ".[]"},
|
|
||||||
"lib.V": {"qualified ident var lib.V lib.T", ".[]"},
|
|
||||||
"lib.T.M": {"method expr (lib.T) M(lib.T)", ".[0]"},
|
"lib.T.M": {"method expr (lib.T) M(lib.T)", ".[0]"},
|
||||||
|
|
||||||
"A{}.B": {"field (main.A) B *main.B", ".[0]"},
|
"A{}.B": {"field (main.A) B *main.B", ".[0]"},
|
||||||
|
@ -775,6 +770,7 @@ func main() {
|
||||||
if want != got {
|
if want != got {
|
||||||
t.Errorf("%s: got %q; want %q", syntax, got, want)
|
t.Errorf("%s: got %q; want %q", syntax, got, want)
|
||||||
}
|
}
|
||||||
|
delete(wantOut, syntax)
|
||||||
|
|
||||||
// We must explicitly assert properties of the
|
// We must explicitly assert properties of the
|
||||||
// Signature's receiver since it doesn't participate
|
// Signature's receiver since it doesn't participate
|
||||||
|
@ -790,6 +786,10 @@ func main() {
|
||||||
t.Error("%s: signature has receiver %s", sig, sig.Recv().Type())
|
t.Error("%s: signature has receiver %s", sig, sig.Recv().Type())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Assert that all wantOut entries were used exactly once.
|
||||||
|
for syntax := range wantOut {
|
||||||
|
t.Errorf("no ast.Selection found with syntax %q", syntax)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestIssue8518(t *testing.T) {
|
func TestIssue8518(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue