Cranelift test for getting an elem from a List Int

This commit is contained in:
Richard Feldman 2020-02-29 20:06:37 -05:00
parent b5fff4c0cd
commit 46f8f2313f

View File

@ -343,15 +343,20 @@ mod test_gen {
assert_evals_to!("1234.0", 1234.0, f64);
}
#[test]
fn basic_int_list() {
assert_crane_evals_to!("List.getUnsafe [ 12, 9, 6, 3 ] 1", 9, i64, |a| a);
}
#[test]
fn branch_first_float() {
assert_evals_to!(
indoc!(
r#"
when 1.23 is
1.23 -> 12
_ -> 34
"#
when 1.23 is
1.23 -> 12
_ -> 34
"#
),
12,
i64