summaryrefslogtreecommitdiffstats
path: root/tests/012/sort.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-08-17 07:15:55 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-08-17 07:15:55 -0700
commit1a4bdbc566683f0e70412fd75af233526803d0d2 (patch)
tree2810e787cba69552aeca6ed73ccfcdfed291ebb6 /tests/012/sort.tl
parent927ce14064e931edcf9f55582fd6a4f4b7c0567c (diff)
downloadtxr-1a4bdbc566683f0e70412fd75af233526803d0d2.tar.gz
txr-1a4bdbc566683f0e70412fd75af233526803d0d2.tar.bz2
txr-1a4bdbc566683f0e70412fd75af233526803d0d2.zip
New function: csort-group.
* autoload.c (csort_set_entries): Register csort-group as autoload trigger for stdlib/csort.tl. * stdlib/csort.tl (csort-group): New function. * tests/012/sort.tl: Tests for sort-group and csort-group. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'tests/012/sort.tl')
-rw-r--r--tests/012/sort.tl10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/012/sort.tl b/tests/012/sort.tl
index 4989a74b..03c122d3 100644
--- a/tests/012/sort.tl
+++ b/tests/012/sort.tl
@@ -78,3 +78,13 @@
(cssort svec) vec
(cssort vec (fun greater)) (reverse vec)
(cssort svec (fun greater)) (reverse vec)))
+
+(mtest
+ [sort-group '((a 1) (b 1) (a 2) (b 2) (a 3) (c 2) (c 1) (a 4)) car]
+ (((a 1) (a 2) (a 3) (a 4))
+ ((b 1) (b 2))
+ ((c 2) (c 1)))
+ [csort-group '((a 1) (b 1) (a 2) (b 2) (a 3) (c 2) (c 1) (a 4)) car]
+ (((a 1) (a 2) (a 3) (a 4))
+ ((b 1) (b 2))
+ ((c 2) (c 1))))