...

Source file src/go/types/errors_test.go

Documentation: go/types

		 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  		{"#foo(T₀)", "foo(T)"},
		19  	} {
		20  		got := stripAnnotations(test.in)
		21  		if got != test.want {
		22  			t.Errorf("%q: got %q; want %q", test.in, got, test.want)
		23  		}
		24  	}
		25  }
		26  

View as plain text