Skip to content
Snippets Groups Projects
Commit 23c9efa2 authored by Michael Anthony Knyszek's avatar Michael Anthony Knyszek Committed by Gopher Robot
Browse files

unique: clean up handle test code

Currently the handle test code has a lot of duplicate type parameters
that are already inferred. This results in IDE warnings which are
annoying. Clean this up by consistently explicitly calling out the type
in the argument, not the type parameter.

Change-Id: I756203f37fc97c793cd5c5e612c6fd1802a84bc1
Reviewed-on: https://go-review.googlesource.com/c/go/+/607356


Reviewed-by: default avatarDavid Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
parent 755c18ec
No related branches found
No related tags found
No related merge requests found
......@@ -30,18 +30,18 @@ type testStruct struct {
}
func TestHandle(t *testing.T) {
testHandle[testString](t, "foo")
testHandle[testString](t, "bar")
testHandle[testString](t, "")
testHandle[testIntArray](t, [4]int{7, 77, 777, 7777})
testHandle[testEface](t, nil)
testHandle[testStringArray](t, [3]string{"a", "b", "c"})
testHandle[testStringStruct](t, testStringStruct{"x"})
testHandle[testStringStructArrayStruct](t, testStringStructArrayStruct{
s: [2]testStringStruct{testStringStruct{"y"}, testStringStruct{"z"}},
testHandle(t, testString("foo"))
testHandle(t, testString("bar"))
testHandle(t, testString(""))
testHandle(t, testIntArray{7, 77, 777, 7777})
testHandle(t, testEface(nil))
testHandle(t, testStringArray{"a", "b", "c"})
testHandle(t, testStringStruct{"x"})
testHandle(t, testStringStructArrayStruct{
s: [2]testStringStruct{{"y"}, {"z"}},
})
testHandle[testStruct](t, testStruct{0.5, "184"})
testHandle[testEface](t, testEface("hello"))
testHandle(t, testStruct{0.5, "184"})
testHandle(t, testEface("hello"))
}
func testHandle[T comparable](t *testing.T, value T) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment