diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-12-20 07:42:29 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-12-20 07:42:29 -0800 |
commit | 6d51949c4820f8eeebd6aacfb443c11b2465f6ab (patch) | |
tree | a583ab0ea91bfeb825ccb647950b943316f2ecfd | |
parent | c1c205100d246a39c9b92a5d1b2296a59783d7d4 (diff) | |
download | txr-6d51949c4820f8eeebd6aacfb443c11b2465f6ab.tar.gz txr-6d51949c4820f8eeebd6aacfb443c11b2465f6ab.tar.bz2 txr-6d51949c4820f8eeebd6aacfb443c11b2465f6ab.zip |
less: bug, vectors not supported.
* lib.c (less_tab_init): Add missing initialization for VEC,
with a priority above CONS: all vectors are greater than
conses. The BUF priority is bumped to 7.
* test/012/less.tl: New file.
-rw-r--r-- | lib.c | 3 | ||||
-rw-r--r-- | tests/012/less.tl | 21 |
2 files changed, 23 insertions, 1 deletions
@@ -6227,11 +6227,12 @@ static void less_tab_init(void) type_prec[STR] = 3; type_prec[SYM] = 4; type_prec[LCONS] = 5; + type_prec[VEC] = 6; type_prec[LSTR] = 3; type_prec[BGNUM] = 1; type_prec[FLNUM] = 1; type_prec[RNG] = 2; - type_prec[BUF] = 6; + type_prec[BUF] = 7; for (l = 0; l <= MAXTYPE; l++) for (r = 0; r <= MAXTYPE; r++) { diff --git a/tests/012/less.tl b/tests/012/less.tl new file mode 100644 index 00000000..11748c7f --- /dev/null +++ b/tests/012/less.tl @@ -0,0 +1,21 @@ +(load "../common") + +(mtest + (less #() #(a)) t + (greater #() #(a)) nil + (less #(0) #(1)) t + (greater #(0) #(1)) nil + (less #(1) #(0)) nil + (greater #(1) #(0)) t + (less #(0) #(0 0)) t + (less #(1) #(0 0)) nil + (less #(0 0) #(0 1)) t + (less #(0 0) #(0 0)) nil + (less #(0 0) #(0 0 0)) t) + +(mtest + (less '() #()) t + (less '(0) #(0)) t + (less "a" #(#\a)) t + (less #() #b'') t + (less #(0) #b'00') t) |