summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-25 13:48:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-25 13:48:26 -0700
commit3bba2beeebf52c11fdcb21a0ea52c7ab9c14c701 (patch)
treeac4fcd5be5b24775facc41700261c0d484c0e674
parent5469c588f55d45ee0a8a8f5031ada885989b861c (diff)
downloadtxr-3bba2beeebf52c11fdcb21a0ea52c7ab9c14c701.tar.gz
txr-3bba2beeebf52c11fdcb21a0ea52c7ab9c14c701.tar.bz2
txr-3bba2beeebf52c11fdcb21a0ea52c7ab9c14c701.zip
matcher: more quasi tests: coverage of all cases.
* tests/011/patmatch.tl: More tests. All explicitly coded cases covered, except the fall-through situations we are not yet catching in expand-quasi-match.
-rw-r--r--tests/011/patmatch.tl9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl
index e9685b87..38df4c62 100644
--- a/tests/011/patmatch.tl
+++ b/tests/011/patmatch.tl
@@ -367,7 +367,14 @@
(test (when-match `@a@b` "abcd" a) "a")
(test (when-match `@a@{b [1..:]}` "acd" a) "a")
(test (when-match `@a@{b [1..:]}` "abcd" a) "ab")
- (test (when-match `@a@{b [0..1]}` "abcd" a) nil))
+ (test (when-match `@a@{b [0..1]}` "abcd" a) nil)
+ (test (when-match `@a@{b [0..2]}d` "abcd" a) "a"))
+
+(let ((x 123))
+ (test (when-match `^@{x 5}$` "^123 $" t) t)
+ (test (when-match `^@{x -5}$` "^ 123$" t) t)
+ (test (when-match `@x@x` "123123" t) t)
+ (test (when-match `@x@{x [1..:]}` "12323" t) t))
(compile-only
(eval-only