mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
fix final list test
This commit is contained in:
parent
1ee1a8114b
commit
d25b1dc549
4 changed files with 36 additions and 26 deletions
|
@ -1807,10 +1807,20 @@ fn list_keep_errs() {
|
|||
assert_evals_to!("List.keepErrs [] (\\x -> x)", 0, i64);
|
||||
assert_evals_to!("List.keepErrs [1,2] (\\x -> Err x)", &[1, 2], &[i64]);
|
||||
assert_evals_to!(
|
||||
"List.keepErrs [0,1,2] (\\x -> x % 0 |> Result.mapErr (\\_ -> 32))",
|
||||
indoc!(
|
||||
r#"
|
||||
mapErr = \result, f ->
|
||||
when result is
|
||||
Err e -> Err ( f e )
|
||||
Ok v -> Ok v
|
||||
|
||||
List.keepErrs [0,1,2] (\x -> x % 0 |> mapErr (\_ -> 32))
|
||||
"#
|
||||
),
|
||||
&[32, 32, 32],
|
||||
&[i64]
|
||||
);
|
||||
|
||||
assert_evals_to!("List.keepErrs [Ok 1, Err 2] (\\x -> x)", &[2], &[i64]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue