mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
add error test case
This commit is contained in:
parent
b802d681a3
commit
d9e9c28889
2 changed files with 18 additions and 1 deletions
|
@ -1780,6 +1780,23 @@ fn replace_unique_int_list() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn replace_unique_int_list_out_of_bounds() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
result = List.replace [ 12, 9, 7, 1, 5 ] 5 33
|
||||
when result is
|
||||
Ok {value} -> value
|
||||
Err OutOfBounds -> -1
|
||||
"#
|
||||
),
|
||||
-1,
|
||||
i64
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm"))]
|
||||
fn replace_unique_int_list_get_old_value() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue