MCPcopy Create free account
hub / github.com/applejag/typ / Comparable

Function Comparable

internal/assert/assert.go:14–18  ·  view source on GitHub ↗

Comparable asserts two comparable values that they equal.

(t *testing.T, name string, want T, got T)

Source from the content-addressed store, hash-verified

12
13// Comparable asserts two comparable values that they equal.
14func Comparable[T comparable](t *testing.T, name string, want T, got T) {
15 if want != got {
16 t.Errorf(`%s: want "%v", got "%v"`, name, want, got)
17 }
18}
19
20// ElementsMatch asserts that two slices of strings contain the same values,
21// with no regard to the ordering.

Callers 15

TestSet_AddSetFunction · 0.92
TestSet_RemoveSetFunction · 0.92
TestSet_RangeFunction · 0.92
TestSet_StringFunction · 0.92
TestArray2D_rowSpanFunction · 0.92
TestArray2D_rowFunction · 0.92
TestSet_AddSetFunction · 0.92
TestSet_RemoveSetFunction · 0.92
TestSet_RangeFunction · 0.92
TestSet_StringFunction · 0.92
TestCountByFunction · 0.92
TestPairsFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestSet_AddSetFunction · 0.74
TestSet_RemoveSetFunction · 0.74
TestSet_RangeFunction · 0.74
TestSet_StringFunction · 0.74
TestArray2D_rowSpanFunction · 0.74
TestArray2D_rowFunction · 0.74
TestSet_AddSetFunction · 0.74
TestSet_RemoveSetFunction · 0.74
TestSet_RangeFunction · 0.74
TestSet_StringFunction · 0.74
TestCountByFunction · 0.74
TestPairsFunction · 0.74