MCPcopy Create free account
hub / github.com/benbjohnson/immutable / testNewComparer

Function testNewComparer

immutable_test.go:2173–2183  ·  view source on GitHub ↗
(t *testing.T, x, y T)

Source from the content-addressed store, hash-verified

2171}
2172
2173func testNewComparer[T constraints.Ordered](t *testing.T, x, y T) {
2174 t.Helper()
2175 c := NewComparer(x)
2176 if c.Compare(x, y) != -1 {
2177 t.Fatal("expected comparer LT")
2178 } else if c.Compare(x, x) != 0 {
2179 t.Fatal("expected comparer EQ")
2180 } else if c.Compare(y, x) != 1 {
2181 t.Fatal("expected comparer GT")
2182 }
2183}
2184
2185// TSortedMap represents a combined immutable and stdlib sorted map.
2186type TSortedMap struct {

Callers 1

TestNewComparerFunction · 0.85

Calls 2

CompareMethod · 0.95
NewComparerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…