summaryrefslogtreecommitdiffstats
path: root/tests/015
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
commit9e7a995846bf23cf9e24ebb9a5bcdc15de478f21 (patch)
tree72e10b4aef9d30ab26c6a1f79b2e735840de3a8e /tests/015
parent3717be6b0d5eb45213fd5d277662d3b32abadeaf (diff)
downloadtxr-9e7a995846bf23cf9e24ebb9a5bcdc15de478f21.tar.gz
txr-9e7a995846bf23cf9e24ebb9a5bcdc15de478f21.tar.bz2
txr-9e7a995846bf23cf9e24ebb9a5bcdc15de478f21.zip
match-str: tests with negative pos.
* tests/015/match-str.tl: Tests added.
Diffstat (limited to 'tests/015')
-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)