summaryrefslogtreecommitdiffstats
path: root/tests/011
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-25 02:33:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-25 02:33:30 -0700
commit2a0ec7b4e5cc388ab8963d961db9311331e8a5a5 (patch)
treed1e1ce49fc571a817a70925fd81c9a18eb0b7850 /tests/011
parentb8237da593d63f83dcf642322b3b2e2f4d72ae8b (diff)
downloadtxr-2a0ec7b4e5cc388ab8963d961db9311331e8a5a5.tar.gz
txr-2a0ec7b4e5cc388ab8963d961db9311331e8a5a5.tar.bz2
txr-2a0ec7b4e5cc388ab8963d961db9311331e8a5a5.zip
matcher: second round of quasi tests and fixes.
* share/txr/stdlib/match.tl (expan-quasi-match): Use rest variable consistently instead of (cdr args). Two instances of (cdr rest) should just be rest. New case added for variable with no modifiers followed by text being the last item.
Diffstat (limited to 'tests/011')
-rw-r--r--tests/011/patmatch.tl6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl
index ad9015db..c40d5ea5 100644
--- a/tests/011/patmatch.tl
+++ b/tests/011/patmatch.tl
@@ -348,6 +348,12 @@
(test (when-match `@a-$` "a-$" a) "a")
(test (when-match `#@a-$` "#a-$" a) "a")
+(test (when-match `#@a-$` "#a-$$" a) nil)
+(test (when-match `#@a-$` "#a-" a) nil)
+(test (when-match `#@{a #/ab*c/}` "#abbbc" a) "abbbc")
+(test (when-match `#@{a #/ab*c/}d` "#abbbcd" a) "abbbc")
+(test (when-match `#@{a 3}@b` "#abb" a) "abb")
+(test (when-match `#@{a 3}@b` "#abbbc" (list a b)) ("abb" "bc"))
(compile-only
(eval-only