summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-28 06:32:31 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-28 06:32:31 -0700
commitbfd36f581181df38c86394bad1c48f6fa19451db (patch)
tree72e10b4aef9d30ab26c6a1f79b2e735840de3a8e
parent4647adffc41d6b10ab5c37f2ed8f5a638e1cf305 (diff)
downloadtxr-bfd36f581181df38c86394bad1c48f6fa19451db.tar.gz
txr-bfd36f581181df38c86394bad1c48f6fa19451db.tar.bz2
txr-bfd36f581181df38c86394bad1c48f6fa19451db.zip
match-str: tests with negative pos.
* tests/015/match-str.tl: Tests added.
-rw-r--r--tests/015/match-str.tl30
1 files changed, 29 insertions, 1 deletions
diff --git a/tests/015/match-str.tl b/tests/015/match-str.tl
index 53e2c73a..2ce34b8f 100644
--- a/tests/015/match-str.tl
+++ b/tests/015/match-str.tl
@@ -38,4 +38,32 @@
(mtest
(match-str "" "" -1) nil
- (match-str "" "" -1) nil)
+ (match-str "a" "" -1) 1
+ (match-str "a" "a" -1) 0
+ (match-str "ab" "a" -1) nil
+ (match-str "ab" "a" -2) 0
+ (match-str "abc" "abc" -1) 0
+ (match-str "abc" "c" -1) 2
+ (match-str "abc" "b" -2) 1
+ (match-str "abc" "a" -3) 0
+ (match-str "abc" "a" -4) nil
+ (match-str "abcd" "cd" -1) 2
+ (match-str "abcd" "bc" -2) 1
+ (match-str "abcd" "ab" -3) 0
+ (match-str "abcd" "ab" -4) nil
+ (match-str "abcd" "ab" -5) nil
+ (match-str (lz "abcd") "cd" -1) 2
+ (match-str (lz "abcd") "bc" -2) 1
+ (match-str (lz "abcd") "ab" -3) 0
+ (match-str (lz "abcd") "ab" -4) nil
+ (match-str (lz "abcd") "ab" -5) nil
+ (match-str "abcd" (lz "cd") -1) 2
+ (match-str "abcd" (lz "bc") -2) 1
+ (match-str "abcd" (lz "ab") -3) 0
+ (match-str "abcd" (lz "ab") -4) nil
+ (match-str "abcd" (lz "ab") -5) nil
+ (match-str (lz "abcd") (lz "cd") -1) 2
+ (match-str (lz "abcd") (lz "bc") -2) 1
+ (match-str (lz "abcd") (lz "ab") -3) 0
+ (match-str (lz "abcd") (lz "ab") -4) nil
+ (match-str (lz "abcd") (lz "ab") -5) nil)