diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-08-17 06:22:21 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-08-17 06:22:21 -0700 |
commit | ce231e5426cb9f2238158e46032215d5b410bd60 (patch) | |
tree | 112e8e09d6110c07b79f2c8432dd561a78b71559 | |
parent | e152f22be647d5f6b4c89cd4cfd639f0482ffbbe (diff) | |
download | txr-ce231e5426cb9f2238158e46032215d5b410bd60.tar.gz txr-ce231e5426cb9f2238158e46032215d5b410bd60.tar.bz2 txr-ce231e5426cb9f2238158e46032215d5b410bd60.zip |
search/rsearch: some test cases.
* tests/012/seq.tl: New tests.
-rw-r--r-- | tests/012/seq.tl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/012/seq.tl b/tests/012/seq.tl index 71bdf5fd..4a1be8dd 100644 --- a/tests/012/seq.tl +++ b/tests/012/seq.tl @@ -499,3 +499,39 @@ (compile-only (test [count #1="abc" '("abc" "abc" "abc" #1# "abc" #1#" abc") eq] 2)) + +(mtest + (search "abcde" "ab") 0 + (search "abcde" "bc") 1 + (search "abcde" "cd") 2 + (search "abcde" "de") 3 + (search "abcde" "e") 4 + (search "abcde" "") 0 + (search "abcde" "x") nil) + +(mtest + (search '#"a b c d e" '#"a b") 0 + (search '#"a b c d e" '#"b c") 1 + (search '#"a b c d e" '#"c d") 2 + (search '#"a b c d e" '#"d e") 3 + (search '#"a b c d e" '#"e") 4 + (search '#"a b c d e" nil) 0 + (search '#"a b c d e" '#"x") nil) + +(mtest + (rsearch "abcde" "ab") 0 + (rsearch "abcde" "bc") 1 + (rsearch "abcde" "cd") 2 + (rsearch "abcde" "de") 3 + (rsearch "abcde" "e") 4 + (rsearch "abcde" "") 5 + (rsearch "abcde" "x") nil) + +(mtest + (rsearch '#"a b c d e" '#"a b") 0 + (rsearch '#"a b c d e" '#"b c") 1 + (rsearch '#"a b c d e" '#"c d") 2 + (rsearch '#"a b c d e" '#"d e") 3 + (rsearch '#"a b c d e" '#"e") 4 + (rsearch '#"a b c d e" nil) 5 + (rsearch '#"a b c d e" '#"x") nil) |