Source file src/go/types/errors_test.go
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 } { 19 got := stripAnnotations(test.in) 20 if got != test.want { 21 t.Errorf("%q: got %q; want %q", test.in, got, test.want) 22 } 23 } 24 } 25