mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
fix str_walk_utf8_with_index
This commit is contained in:
parent
8d4a770373
commit
91a11a70af
1 changed files with 12 additions and 0 deletions
|
@ -1731,6 +1731,7 @@ fn str_split_last() {
|
|||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn str_walk_utf8_with_index() {
|
||||
#[cfg(not(feature = "gen-llvm-wasm"))]
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
|
@ -1740,6 +1741,17 @@ fn str_walk_utf8_with_index() {
|
|||
RocList::from_slice(&[(0, b'a'), (1, b'b'), (2, b'c'), (3, b'd')]),
|
||||
RocList<(u64, u8)>
|
||||
);
|
||||
|
||||
#[cfg(feature = "gen-llvm-wasm")]
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
Str.walkUtf8WithIndex "abcd" [] (\list, byte, index -> List.append list (Pair index byte))
|
||||
"#
|
||||
),
|
||||
RocList::from_slice(&[(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd')]),
|
||||
RocList<(u32, char)>
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue