diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-02-04 19:39:39 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-02-04 19:39:39 -0800 |
commit | 1bc3c2aa2cf90fcf8e52b8662b3227130b8ed5de (patch) | |
tree | b72a33e42a4a3a671c269e8110cd84af25276f46 /tests/011/patmatch.tl | |
parent | f4c54fbad69d1181057fe5025f537802b9eec610 (diff) | |
download | txr-1bc3c2aa2cf90fcf8e52b8662b3227130b8ed5de.tar.gz txr-1bc3c2aa2cf90fcf8e52b8662b3227130b8ed5de.tar.bz2 txr-1bc3c2aa2cf90fcf8e52b8662b3227130b8ed5de.zip |
matcher: bug: quasiliteral allowing prefix matches.
* stdlib/match.tl (expand-quasi-match): When matching `text`
or `@var`, which are matching in the final position of the
specimen, it is not good enough that match-str returns true;
we must check that the entire string was matched.
Reported by Paul A. Patience.
Diffstat (limited to 'tests/011/patmatch.tl')
-rw-r--r-- | tests/011/patmatch.tl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/011/patmatch.tl b/tests/011/patmatch.tl index 4b44eca9..c9eb3d39 100644 --- a/tests/011/patmatch.tl +++ b/tests/011/patmatch.tl @@ -355,7 +355,10 @@ (mtest (when-match `` "" t) t (when-match `abc` "abc" t) t - (when-match `@a` "abc" a) "abc") + (when-match `abc` "abcdef" t) nil + (when-match `@a` "abc" a) "abc" + (let ((x "foo")) (when-match `@x` "foobar" t)) nil + (let ((x "foo")) (when-match `@x` "foo" x)) "foo") (mtest (when-match `@a@b` "abc" a) :error |