mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
parent
cca2d10f41
commit
6e5c1d5914
2 changed files with 49 additions and 3 deletions
|
@ -2490,3 +2490,41 @@ fn monomorphized_ints_aliased() {
|
|||
u8
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn to_float_f32() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
n : U8
|
||||
n = 100
|
||||
|
||||
f : F32
|
||||
f = Num.toFloat n
|
||||
f
|
||||
"#
|
||||
),
|
||||
100.,
|
||||
f32
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||
fn to_float_f64() {
|
||||
assert_evals_to!(
|
||||
indoc!(
|
||||
r#"
|
||||
n : U8
|
||||
n = 100
|
||||
|
||||
f : F64
|
||||
f = Num.toFloat n
|
||||
f
|
||||
"#
|
||||
),
|
||||
100.,
|
||||
f64
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue