mirror of
https://github.com/golang/go
synced 2024-11-11 22:10:22 -07:00
[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 <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
dc122c7a9c
commit
ca2f152893
25
src/go/types/errors_test.go
Normal file
25
src/go/types/errors_test.go
Normal file
@ -0,0 +1,25 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package types
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestStripAnnotations(t *testing.T) {
|
||||
for _, test := range []struct {
|
||||
in, want string
|
||||
}{
|
||||
{"", ""},
|
||||
{" ", " "},
|
||||
{"foo", "foo"},
|
||||
{"foo₀", "foo"},
|
||||
{"foo(T₀)", "foo(T)"},
|
||||
{"#foo(T₀)", "foo(T)"},
|
||||
} {
|
||||
got := stripAnnotations(test.in)
|
||||
if got != test.want {
|
||||
t.Errorf("%q: got %q; want %q", test.in, got, test.want)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user