summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-01 22:26:22 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-01 22:26:22 -0700
commitc65c90b0458f3cc9ae027ff0f256e5a587de030f (patch)
tree5db307bfff22c731063e04e485f795ad7f40e35f
parent9d62dcc6c87a98faad5a494bbd7d472d1e648d47 (diff)
downloadtxr-c65c90b0458f3cc9ae027ff0f256e5a587de030f.tar.gz
txr-c65c90b0458f3cc9ae027ff0f256e5a587de030f.tar.bz2
txr-c65c90b0458f3cc9ae027ff0f256e5a587de030f.zip
sort: larger test.
* tests/010/sort.tl: Add some test cases of larger list. The exhaustive permutation tests are good but only go up to a relatively short size, where the median-of-three doesn't even kick in. We also cover choosing an alternative less function.
-rw-r--r--tests/010/sort.tl8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/010/sort.tl b/tests/010/sort.tl
index 40ba8519..1fd48531 100644
--- a/tests/010/sort.tl
+++ b/tests/010/sort.tl
@@ -13,3 +13,11 @@
(sp (uniq [mapcar sort (perm vec (len vec))])))
(mvtest (len sp) 1
(car sp) vec))
+
+(let* ((list (range* 0 1000))
+ (slist (shuffle list)))
+ (mvtest
+ (sort list) list
+ (sort slist) list
+ (sort list (fun greater)) (reverse list)
+ (sort slist (fun greater)) (reverse list)))