mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Nat overflow is different between targets
This commit is contained in:
parent
775517a8cf
commit
df865222bf
1 changed files with 7 additions and 1 deletions
|
@ -2376,6 +2376,13 @@ fn min_f32() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(all(any(feature = "gen-llvm"), not(feature = "gen-llvm-wasm")))]
|
||||
fn to_nat_truncate_wraps() {
|
||||
let input = "Num.toNat 10_000_000_000_000_000_000_000i128";
|
||||
assert_evals_to!(&input, 1864712049423024128, u64)
|
||||
}
|
||||
|
||||
macro_rules! num_conversion_tests {
|
||||
($($fn:expr, $typ:ty, ($($test_name:ident, $input:expr, $output:expr $(, [$($support_gen:literal),*])? )*))*) => {$($(
|
||||
#[test]
|
||||
|
@ -2446,7 +2453,6 @@ num_conversion_tests! {
|
|||
to_nat_same_width, "15i64", 15, ["gen-wasm"]
|
||||
to_nat_extend, "15i8", 15, ["gen-wasm"]
|
||||
to_nat_truncate, "115i128", 115
|
||||
to_nat_truncate_wraps, "10_000_000_000_000_000_000_000i128", 1864712049423024128
|
||||
)
|
||||
"Num.toF32", f32, (
|
||||
to_f32_from_i8, "15i8", 15.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue