We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ee053e commit 2537216Copy full SHA for 2537216
src/hash/maphash/maphash_test.go
@@ -254,12 +254,17 @@ func TestComparable(t *testing.T) {
254
}
255
testComparable(t, s1, s2)
256
testComparable(t, s1.s, s2.s)
257
+ c1 := make(chan struct{})
258
+ c2 := make(chan struct{})
259
+ testComparable(t, c1, c1)
260
+ testComparable(t, chan struct{}(nil))
261
testComparable(t, float32(0), negativeZero[float32]())
262
testComparable(t, float64(0), negativeZero[float64]())
263
testComparableNoEqual(t, math.NaN(), math.NaN())
264
testComparableNoEqual(t, [2]string{"a", ""}, [2]string{"", "a"})
265
testComparableNoEqual(t, struct{ a, b string }{"foo", ""}, struct{ a, b string }{"", "foo"})
266
testComparableNoEqual(t, struct{ a, b any }{int(0), struct{}{}}, struct{ a, b any }{struct{}{}, int(0)})
267
+ testComparableNoEqual(t, c1, c2)
268
269
270
func testComparableNoEqual[T comparable](t *testing.T, v1, v2 T) {
0 commit comments