MCPcopy
hub / github.com/destel/rill / ExpectSorted

Function ExpectSorted

internal/th/assertions.go:87–95  ·  view source on GitHub ↗
(t *testing.T, arr []T)

Source from the content-addressed store, hash-verified

85}
86
87func ExpectSorted[T ordered](t *testing.T, arr []T) {
88 t.Helper()
89 isSorted := sort.SliceIsSorted(arr, func(i, j int) bool {
90 return arr[i] <= arr[j]
91 })
92 if !isSorted {
93 t.Errorf("expected sorted slice")
94 }
95}
96
97func ExpectUnsorted[T ordered](t *testing.T, arr []T) {
98 t.Helper()

Callers 10

TestSplit2Function · 0.92
TestMapFunction · 0.92
TestFilterFunction · 0.92
TestFilterMapFunction · 0.92
TestFlatMapFunction · 0.92
TestCatchFunction · 0.92
TestBatchFunction · 0.92
TestFilterMapFunction · 0.92
TestLoopFunction · 0.92
TestForEachFunction · 0.92

Calls

no outgoing calls

Tested by 10

TestSplit2Function · 0.74
TestMapFunction · 0.74
TestFilterFunction · 0.74
TestFilterMapFunction · 0.74
TestFlatMapFunction · 0.74
TestCatchFunction · 0.74
TestBatchFunction · 0.74
TestFilterMapFunction · 0.74
TestLoopFunction · 0.74
TestForEachFunction · 0.74