Add List.findLastIndex gen tests

This commit is contained in:
Richard Feldman 2022-07-22 10:46:09 -04:00 committed by Folkert
parent 97720c4090
commit c3cfc0d396
No known key found for this signature in database
GPG Key ID: 1F17F6FFD112B97C

View File

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