summaryrefslogtreecommitdiffstats
path: root/tests/011
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-02-02 06:26:14 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-02-02 06:26:14 -0800
commitf035e79310802af5370d40589ac7db850eff5a14 (patch)
treebabaa7e1224aff85a49553b26d18198a18141a8d /tests/011
parent3546eefbbaefac9457e4f18c1d2ed0aba5a6b933 (diff)
downloadtxr-f035e79310802af5370d40589ac7db850eff5a14.tar.gz
txr-f035e79310802af5370d40589ac7db850eff5a14.tar.bz2
txr-f035e79310802af5370d40589ac7db850eff5a14.zip
matcher: new failing backreferencing test case.
* tests/011/patmatch.tl: New test cases that break. The (copy var-list) logic in the handling of and and or is incomplete. The bifurcated vars must be merged together into the original vars. Without this, it looks as if the operator didn't bind any variables, and they can be repeated again without backreferencing. In the broken examples, variable a is taking on the value 2 instead of mismatching the previous value of 1.
Diffstat (limited to 'tests/011')
-rw-r--r--tests/011/patmatch.tl4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl
index 0068eabb..46fc2719 100644
--- a/tests/011/patmatch.tl
+++ b/tests/011/patmatch.tl
@@ -90,6 +90,10 @@
(test (when-match @(or @(require @a (oddp a)) @b @c) 2 (list a b c))
(nil 2 nil))
+(test (if-match (@(or @a) @a) '(1 2) a :no) :no)
+(test (if-match (@(and @a) @a) '(1 2) a :no) :no)
+
+
(test
(collect-each ((obj (list '(1 2 3)
'(4 5)