summaryrefslogtreecommitdiff
path: root/sort/sort_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2020-07-17 09:58:23 +0100
committerPaul Buetow <paul@buetow.org>2020-07-17 09:58:23 +0100
commite858efc16960b86175d655add938acd3f1edd13e (patch)
tree94bb8eb0487b45ebbe65b24b2e1468e96362c262 /sort/sort_test.go
parent82a314d3f211f9da4f0a906ccbe2df279c79e6de (diff)
shuffle sort works
Diffstat (limited to 'sort/sort_test.go')
-rw-r--r--sort/sort_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/sort/sort_test.go b/sort/sort_test.go
index d8250c4..ad75fff 100644
--- a/sort/sort_test.go
+++ b/sort/sort_test.go
@@ -34,7 +34,7 @@ func TestShellSort(t *testing.T) {
}
func TestShuffleSort(t *testing.T) {
- for i := 1; i <= maxLength; i *= 10 {
+ for i := 10; i <= maxLength; i *= 10 {
testShuffle(Shuffle, i, t)
}
}
@@ -57,6 +57,12 @@ func BenchmarkShellSort(b *testing.B) {
}
}
+func BenchmarkShuffleSort(b *testing.B) {
+ for i := 1; i <= maxLength; i *= 10 {
+ benchmark(Shuffle, i, b)
+ }
+}
+
func test(sort sortAlgorithm, length int, t *testing.T) {
cb := func(t *testing.T) {
t.Parallel()
@@ -92,6 +98,5 @@ func benchmark(sort sortAlgorithm, length int, b *testing.B) {
}
func makeIntegers(length, max int) ds.ArrayList {
- //return ds.ReverseSortedIntegers(length)
return ds.RandomIntegers(length, max)
}