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

Function TestSortPairsInt

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

Source from the content-addressed store, hash-verified

6)
7
8func TestSortPairsInt(t *testing.T) {
9 pairs := []Pair[int, int]{
10 {V1: 3, V2: 10},
11 {V1: 1, V2: 20},
12 {V1: 1, V2: 5},
13 {V1: 2, V2: 15},
14 }
15 expected := []Pair[int, int]{
16 {V1: 1, V2: 5},
17 {V1: 1, V2: 20},
18 {V1: 2, V2: 15},
19 {V1: 3, V2: 10},
20 }
21 SortPairs(pairs)
22 if !reflect.DeepEqual(pairs, expected) {
23 t.Fatalf("expected %v, got %v", expected, pairs)
24 }
25}
26
27func TestSortPairsString(t *testing.T) {
28 pairs := []Pair[string, string]{

Callers

nothing calls this directly

Calls 1

SortPairsFunction · 0.85

Tested by

no test coverage detected