mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
test(Str.toNum): add float test case
This commit is contained in:
parent
d6ed2147ae
commit
b58a965e08
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue