add error test case

This commit is contained in:
Brendan Hansknecht 2022-02-27 00:45:51 -08:00
parent b802d681a3
commit d9e9c28889
2 changed files with 18 additions and 1 deletions

View file

@ -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() {