diff options
| author | Paul Buetow <paul@buetow.org> | 2020-07-21 20:41:37 +0100 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2020-07-21 20:41:37 +0100 |
| commit | de286db8594d547591ff765f4d5934d99248779b (patch) | |
| tree | d1c13a4a9ba1d60f60d9cda978b4a03f8ddd49ac /sort/sort_test.go | |
| parent | dbd6388393282672859c789b0e1b58d4f8fd0d0b (diff) | |
merge sort works
Diffstat (limited to 'sort/sort_test.go')
| -rw-r--r-- | sort/sort_test.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sort/sort_test.go b/sort/sort_test.go index ad75fff..59e0226 100644 --- a/sort/sort_test.go +++ b/sort/sort_test.go @@ -33,6 +33,12 @@ func TestShellSort(t *testing.T) { } } +func TestMergeSort(t *testing.T) { + for i := 1; i <= maxLength; i *= 10 { + test(Merge, i, t) + } +} + func TestShuffleSort(t *testing.T) { for i := 10; i <= maxLength; i *= 10 { testShuffle(Shuffle, i, t) @@ -57,6 +63,12 @@ func BenchmarkShellSort(b *testing.B) { } } +func BenchmarkMergeSort(b *testing.B) { + for i := 1; i <= maxLength; i *= 10 { + benchmark(Merge, i, b) + } +} + func BenchmarkShuffleSort(b *testing.B) { for i := 1; i <= maxLength; i *= 10 { benchmark(Shuffle, i, b) |
