From ca2f15289337f57dcfb938000af249532f79e4d4 Mon Sep 17 00:00:00 2001 From: Rob Findley Date: Wed, 3 Feb 2021 21:57:06 -0500 Subject: [PATCH] [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 --- src/go/types/errors_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/go/types/errors_test.go 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) + } + } +} -- 2.48.1