From: Rob Findley Date: Thu, 4 Feb 2021 02:57:06 +0000 (-0500) Subject: [dev.typeparams] go/types: add missing test from dev.go2go X-Git-Tag: go1.17beta1~1473^2~47 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ca2f15289337f57dcfb938000af249532f79e4d4;p=gostls13.git [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 Run-TryBot: Robert Findley TryBot-Result: Go Bot Reviewed-by: Robert Griesemer --- diff --git a/src/go/types/errors_test.go b/src/go/types/errors_test.go new file mode 100644 index 0000000000..fdbe07cae0 --- /dev/null +++ b/src/go/types/errors_test.go @@ -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) + } + } +}