MCPcopy Create free account
hub / github.com/encodeous/nylon / TestSortPairsString

Function TestSortPairsString

state/pair_test.go:27–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

25}
26
27func TestSortPairsString(t *testing.T) {
28 pairs := []Pair[string, string]{
29 {V1: "b", V2: "y"},
30 {V1: "a", V2: "z"},
31 {V1: "a", V2: "x"},
32 {V1: "c", V2: "w"},
33 }
34 expected := []Pair[string, string]{
35 {V1: "a", V2: "x"},
36 {V1: "a", V2: "z"},
37 {V1: "b", V2: "y"},
38 {V1: "c", V2: "w"},
39 }
40 SortPairs(pairs)
41 if !reflect.DeepEqual(pairs, expected) {
42 t.Fatalf("expected %v, got %v", expected, pairs)
43 }
44}

Callers

nothing calls this directly

Calls 1

SortPairsFunction · 0.85

Tested by

no test coverage detected