test(Str.toNum): add float test case

This commit is contained in:
rvcas 2021-12-02 15:13:39 -05:00
parent d6ed2147ae
commit b58a965e08

View file

@ -1314,3 +1314,20 @@ fn str_to_num() {
i64
);
}
#[test]
#[cfg(any(feature = "gen-llvm"))]
fn str_to_num_float() {
assert_evals_to!(
indoc!(
r#"
when Str.toNum "1.0" is
Ok n -> n + 2.0
Err _ -> 0
"#
),
3.0,
f64
);
}