From 9e7a995846bf23cf9e24ebb9a5bcdc15de478f21 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 28 Apr 2021 06:32:31 -0700 Subject: match-str: tests with negative pos. * tests/015/match-str.tl: Tests added. --- tests/015/match-str.tl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3