mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-21 07:49:17 +03:00
Add List.findLastIndex gen tests
This commit is contained in:
parent
97720c4090
commit
c3cfc0d396
@ -2926,6 +2926,18 @@ fn list_find_index() {
|
||||
1,
|
||||
usize
|
||||
);
|
||||
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.findLastIndex ["a", "bc", "def"] (\s -> Str.countGraphemes s > 1) is
|
||||
Ok v -> v
|
||||
Err _ -> 999
|
||||
"#
|
||||
),
|
||||
2,
|
||||
usize
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2942,6 +2954,18 @@ fn list_find_index_not_found() {
|
||||
999,
|
||||
usize
|
||||
);
|
||||
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.findLastIndex ["a", "bc", "def"] (\s -> Str.countGraphemes s > 5) is
|
||||
Ok v -> v
|
||||
Err _ -> 999
|
||||
"#
|
||||
),
|
||||
999,
|
||||
usize
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -2958,6 +2982,18 @@ fn list_find_index_empty_typed_list() {
|
||||
999,
|
||||
usize
|
||||
);
|
||||
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.findLastIndex [] (\s -> Str.countGraphemes s > 5) is
|
||||
Ok v -> v
|
||||
Err _ -> 999
|
||||
"#
|
||||
),
|
||||
999,
|
||||
usize
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user