diff options
author | bd <bdunahu@operationnull.com> | 2024-05-18 23:08:30 -0600 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2024-05-18 23:08:30 -0600 |
commit | f69448ded971deb6a702894499c718e4a26857dd (patch) | |
tree | 18b8d6d8fbe620f3bec8333650b22e08fbb5e367 /bubble/bubble-sort-test.scm | |
parent | 5a65e2da159703e20504b7b3a668e65312932394 (diff) |
Finish bubble-sort
Diffstat (limited to 'bubble/bubble-sort-test.scm')
-rw-r--r-- | bubble/bubble-sort-test.scm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/bubble/bubble-sort-test.scm b/bubble/bubble-sort-test.scm index c870577..daa59d7 100644 --- a/bubble/bubble-sort-test.scm +++ b/bubble/bubble-sort-test.scm @@ -8,5 +8,29 @@ '() (bubble-sort '())) +(test-equal "in-order" + '(0 1) + (bubble-sort '(0 1))) + +(test-equal "in-order-large" + '(0 1 2 5 6 9 19 101) + (bubble-sort '(0 1 2 5 6 9 19 101))) + +(test-equal "single-swap" + '(0 1) + (bubble-sort '(1 0))) + +(test-equal "double-swap" + '(0 1 5 6) + (bubble-sort '(1 0 6 5))) + +(test-equal "total-reversal" + '(0 1 2 3 4 5 6 7 8 9) + (bubble-sort '(9 8 7 6 5 4 3 2 1 0))) + +(test-equal "random-scramble" + '(-9 -2 0 11 45) + (bubble-sort '(-2 45 0 11 -9))) + (test-end "harness") |