summaryrefslogtreecommitdiffstats
path: root/tests/011/patmatch.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-26 07:40:41 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-26 07:40:41 -0700
commit80adc0257a941ccda132ca04a15ed98727fd8199 (patch)
treee22841e130cd8defe48801c2676d28f5e45af619 /tests/011/patmatch.tl
parent6aa7f5abfb2e4c396b7f76ded0ef7dbded89c957 (diff)
downloadtxr-80adc0257a941ccda132ca04a15ed98727fd8199.tar.gz
txr-80adc0257a941ccda132ca04a15ed98727fd8199.tar.bz2
txr-80adc0257a941ccda132ca04a15ed98727fd8199.zip
matcher: quasi match incorrectly treats nil as bound.
* share/txr/stdlib/match.tl (expand-quasi-match): bound-p local function must return nil if the symbol is nil. * share/txr/stdlib/match.tl: New test cases testing that @nil is treated as an unbound variable in the non-consecutive-variables test. Also, making duplicates of certain tests that start with a text match and sticking @nil as the first element into them, so that the text match is forced to be the second item.
Diffstat (limited to 'tests/011/patmatch.tl')
-rw-r--r--tests/011/patmatch.tl6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl
index 063e574b..54dda990 100644
--- a/tests/011/patmatch.tl
+++ b/tests/011/patmatch.tl
@@ -344,7 +344,11 @@
(test (when-match `@a` "abc" a) "abc")
(macro-time-let ((*stderr* *stdnull*))
- (test (when-match `@a@b` "abc" a) :error))
+ (test (when-match `@a@b` "abc" a) :error)
+ (test (when-match `@nil@b` "abc" a) :error)
+ (test (when-match `@nil@nil` "abc" a) :error)
+ (test (when-match `@a@nil` "abc" a) :error))
+
(test (when-match `@a-$` "a-$" a) "a")
(test (when-match `#@a-$` "#a-$" a) "a")