Implement List.any

This commit is contained in:
Kevin Sjöberg 2021-11-05 23:34:10 +01:00
parent 0e500ba33c
commit 44938a9e35
15 changed files with 137 additions and 6 deletions

View file

@ -2160,6 +2160,13 @@ fn list_sort_with() {
);
}
#[test]
fn list_any() {
assert_evals_to!("List.any [] (\\e -> e > 3)", false, bool);
assert_evals_to!("List.any [ 1, 2, 3 ] (\\e -> e > 3)", false, bool);
assert_evals_to!("List.any [ 1, 2, 4 ] (\\e -> e > 3)", true, bool);
}
#[test]
#[should_panic(expected = r#"Roc failed with message: "invalid ret_layout""#)]
fn lists_with_incompatible_type_param_in_if() {