Skip to content

Commit ca2f152

Browse files
committed
[dev.typeparams] go/types: add missing test from dev.go2go
errors_test.go was missed during merging. Add it. Change-Id: I321f08ae16ca02586875e1c7776f5d78f8690b4d Reviewed-on: https://go-review.googlesource.com/c/go/+/289549 Trust: Robert Findley <[email protected]> Run-TryBot: Robert Findley <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Robert Griesemer <[email protected]>
1 parent dc122c7 commit ca2f152

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/go/types/errors_test.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2020 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 types
6+
7+
import "testing"
8+
9+
func TestStripAnnotations(t *testing.T) {
10+
for _, test := range []struct {
11+
in, want string
12+
}{
13+
{"", ""},
14+
{" ", " "},
15+
{"foo", "foo"},
16+
{"foo₀", "foo"},
17+
{"foo(T₀)", "foo(T)"},
18+
{"#foo(T₀)", "foo(T)"},
19+
} {
20+
got := stripAnnotations(test.in)
21+
if got != test.want {
22+
t.Errorf("%q: got %q; want %q", test.in, got, test.want)
23+
}
24+
}
25+
}

0 commit comments

Comments
 (0)