Skip to content

Commit

Permalink
[dev.typeparams] go/types: add missing test from dev.go2go
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
findleyr committed Feb 4, 2021
1 parent dc122c7 commit ca2f152
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/go/types/errors_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
}
}

0 comments on commit ca2f152

Please sign in to comment.