1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-15 15:57:41 +00:00
Allow for a zero length match at the end of a string when using the
to or thru combinators.
This commit is contained in:
Calvin Rose
2021-02-19 16:10:03 -06:00
parent 92928d5c4f
commit 742469a8bc
2 changed files with 10 additions and 2 deletions

View File

@@ -473,4 +473,12 @@
(check-deep '(* (int 2) -1) "123" nil)
# to/thru bug
(check-deep '(to -1) "aaaa" @[])
(check-deep '(thru -1) "aaaa" @[])
(check-deep ''(to -1) "aaaa" @["aaaa"])
(check-deep ''(thru -1) "aaaa" @["aaaa"])
(check-deep '(to "b") "aaaa" nil)
(check-deep '(thru "b") "aaaa" nil)
(end-suite)