mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
add builtin List.min
This commit is contained in:
parent
d7083d5daf
commit
c721a1cc1f
4 changed files with 159 additions and 1 deletions
|
@ -1949,6 +1949,31 @@ fn list_contains() {
|
|||
|
||||
assert_evals_to!(indoc!("List.contains [] 4"), false, bool);
|
||||
}
|
||||
#[test]
|
||||
fn list_min() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.min [] is
|
||||
Ok val -> val
|
||||
Err _ -> -1
|
||||
"#
|
||||
),
|
||||
-1,
|
||||
i64
|
||||
);
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
when List.min [3, 1, 2] is
|
||||
Ok val -> val
|
||||
Err _ -> -1
|
||||
"#
|
||||
),
|
||||
1,
|
||||
i64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn list_sum() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue