1
0
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:
Rob Findley 2021-02-03 21:57:06 -05:00 committed by Robert Findley
parent dc122c7a9c
commit ca2f152893

View 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)
}
}
}