diff options
Diffstat (limited to 'sort/selection_test.go')
| -rw-r--r-- | sort/selection_test.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sort/selection_test.go b/sort/selection_test.go index 3881850..c5d6beb 100644 --- a/sort/selection_test.go +++ b/sort/selection_test.go @@ -5,8 +5,16 @@ import ( "testing" ) -func BenchmarkSelection1000(b *testing.B) { +func BenchmarkSelection(b *testing.B) { + benchmark("Selection", 10, Selection, b) + benchmark("Selection", 100, Selection, b) + benchmark("Selection", 1000, Selection, b) +} + +func TestSelection1000(t *testing.T) { a := ds.RandomIntegers(1000, 1000) - b.ResetTimer() - Selection(a) + a = Selection(a) + if !Sorted(a) { + t.Errorf("Array not sorted: %v", a) + } } |
