(t *testing.T, arr []T)
| 85 | } |
| 86 | |
| 87 | func 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 | |
| 97 | func ExpectUnsorted[T ordered](t *testing.T, arr []T) { |
| 98 | t.Helper() |
no outgoing calls