From f28ccd1afb2a87c7ac8dfef2f43397bff5d1df97 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 25 Apr 2021 13:48:26 -0700 Subject: 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. --- tests/011/patmatch.tl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3