mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
fix string split on overlapping delimiters
This commit is contained in:
parent
e5c0939bbe
commit
d52c037cba
2 changed files with 89 additions and 2 deletions
|
@ -1801,6 +1801,26 @@ fn str_split_last_not_found() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn str_split_overlapping_substring_1() {
|
||||
assert_evals_to!(
|
||||
r#"Str.split "aaa" "aa""#,
|
||||
RocList::from_slice(&[RocStr::from(""), RocStr::from("a")]),
|
||||
RocList<RocStr>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn str_split_overlapping_substring_2() {
|
||||
assert_evals_to!(
|
||||
r#"Str.split "aaaa" "aa""#,
|
||||
RocList::from_slice(&[RocStr::from(""), RocStr::from(""), RocStr::from("")]),
|
||||
RocList<RocStr>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn str_walk_utf8_with_index() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue