summaryrefslogtreecommitdiff
path: root/sort/sort_test.go
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2020-08-07 11:14:35 +0100
committerPaul Buetow <pbuetow@mimecast.com>2020-08-07 11:14:35 +0100
commitdeaa4e1c33cd2c1c75f698881918688055abfa51 (patch)
treec6a82fec9cc3030f169d0b4441a8c63dd6bd1ea1 /sort/sort_test.go
parentd4c15be3268ee675b0d5853a8ffdb6c4c92585e7 (diff)
add quick2
Diffstat (limited to 'sort/sort_test.go')
-rw-r--r--sort/sort_test.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/sort/sort_test.go b/sort/sort_test.go
index a0e4729..3a44827 100644
--- a/sort/sort_test.go
+++ b/sort/sort_test.go
@@ -62,6 +62,12 @@ func TestQuickSort(t *testing.T) {
}
}
+func TestQuick2Sort(t *testing.T) {
+ for i := 1; i <= maxLength; i *= 10 {
+ test(Quick2, i, t)
+ }
+}
+
func TestShuffleSort(t *testing.T) {
for i := 10; i <= maxLength; i *= 10 {
testShuffle(Shuffle, i, t)
@@ -110,6 +116,12 @@ func BenchmarkQuickSort(b *testing.B) {
}
}
+func BenchmarkQuick2Sort(b *testing.B) {
+ for i := 1; i <= maxLength; i *= 10 {
+ benchmark(Quick2, i, b)
+ }
+}
+
func BenchmarkShuffleSort(b *testing.B) {
for i := 1; i <= maxLength; i *= 10 {
benchmark(Shuffle, i, b)