mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
adding initial List.all
This commit is contained in:
parent
b03ed18553
commit
d946b84e63
17 changed files with 160 additions and 4 deletions
|
@ -2352,6 +2352,28 @@ fn list_any_empty_with_unknown_element_type() {
|
|||
assert_evals_to!("List.any [] (\\_ -> True)", false, bool);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn list_all() {
|
||||
assert_evals_to!("List.all [] (\\e -> e > 3)", false, bool);
|
||||
assert_evals_to!("List.all [ 1, 2, 3 ] (\\e -> e > 3)", false, bool);
|
||||
assert_evals_to!("List.all [ 1, 2, 4 ] (\\e -> e > 3)", false, bool);
|
||||
assert_evals_to!("List.all [ 1, 2, 3 ] (\\e -> e >= 1", true, bool);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
#[should_panic(expected = r#"Roc failed with message: "UnresolvedTypeVar"#)]
|
||||
fn list_all_empty_with_unknown_element_type() {
|
||||
// Segfaults with invalid memory reference. Running this as a stand-alone
|
||||
// Roc program, generates the following error message:
|
||||
//
|
||||
// Application crashed with message
|
||||
// UnresolvedTypeVar compiler/mono/src/ir.rs line 3775
|
||||
// Shutting down
|
||||
assert_evals_to!("List.all [] (\\_ -> True)", false, bool);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
#[should_panic(expected = r#"Roc failed with message: "invalid ret_layout""#)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue