fixing List.all on empty list to be true

This commit is contained in:
Michael Downey 2021-11-17 22:47:49 -05:00
parent 81f0f46132
commit c5484a9ad3
2 changed files with 2 additions and 2 deletions

View File

@ -1136,7 +1136,7 @@ pub fn listAll(
}
return true;
}
return false;
return true;
}
// SWAP ELEMENTS

View File

@ -2355,7 +2355,7 @@ fn list_any_empty_with_unknown_element_type() {
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn list_all() {
assert_evals_to!("List.all [] (\\e -> e > 3)", false, bool);
assert_evals_to!("List.all [] (\\e -> e > 3)", true, 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);