diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-02-02 06:26:14 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-02-02 06:26:14 -0800 |
commit | f035e79310802af5370d40589ac7db850eff5a14 (patch) | |
tree | babaa7e1224aff85a49553b26d18198a18141a8d | |
parent | 3546eefbbaefac9457e4f18c1d2ed0aba5a6b933 (diff) | |
download | txr-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.
-rw-r--r-- | tests/011/patmatch.tl | 4 |
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) |