1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-31 07:33:01 +00:00

Fix #548 - string/split bug.

Also update docstrings for string/find. The 'skipping'
behavior that was documented only applies to to string/replace-all.
This commit is contained in:
Calvin Rose
2021-01-05 18:53:00 -06:00
parent 665b1e68d5
commit bcba0c0279
2 changed files with 11 additions and 4 deletions

View File

@@ -131,4 +131,10 @@
(check-indent "\n Hello, world!\n dedented text\n " 4)
(check-indent "\n Hello, world!\n indented text\n " 4)
# String bugs
(assert (deep= (string/find-all "qq" "qqq") @[0 1]) "string/find-all 1")
(assert (deep= (string/find-all "q" "qqq") @[0 1 2]) "string/find-all 2")
(assert (deep= (string/split "qq" "1qqqqz") @["1" "" "z"]) "string/split 1")
(assert (deep= (string/split "aa" "aaa") @["" "a"]) "string/split 2")
(end-suite)