You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Corrects `/-/.split("a-")` to return `["a", ""]` instead of `["a"]`.
(`/-/` is shorthand for `Regex::new("-").unwrap()`.)
This adds tests for both `split()` and `splitn()` covering a variety of
edge cases. One test is commented out because it is failing due to #521.
A future commit will fix it.
Note that the `split2` and `split3` tests were passing incorrectly
before this change. I have fixed them to expect the correct values.
Fixes#627
I ran into a few bugs:
"-"
"a"
["a"]
["a"]
"-"
"a-"
["a", ""]
["a"]
"-"
"a--"
["a", "", ""]
["a", ""]
"-"
"a"
["a"]
["a", ""]
"-"
"a-"
["a", ""]
["a", ""]
"-"
"a--"
["a", "-"]
["a", "-"]
See also #521:
splitn
incorrectly returns a trailing""
if there is one fewer part than the limit.The text was updated successfully, but these errors were encountered: