]> Cypherpunks repositories - gostls13.git/commitdiff
unique: clean up handle test code
authorMichael Anthony Knyszek <mknyszek@google.com>
Wed, 21 Aug 2024 14:42:33 +0000 (14:42 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 21 Aug 2024 16:03:47 +0000 (16:03 +0000)
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: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>

src/unique/handle_test.go

index b031bbf6852c6b33051ce4ecdfb4ff2fae8fd977..ffb2be42b127453e15da1989b93d9608f0da0a67 100644 (file)
@@ -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) {