fix str_walk_utf8_with_index

This commit is contained in:
Folkert 2022-07-24 14:04:41 +02:00
parent 8d4a770373
commit 91a11a70af
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -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]