Merge branch 'main' into int_overflow

This commit is contained in:
wizard7377 2024-11-28 21:26:38 -05:00 committed by GitHub
commit 7866331f67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 88 additions and 43 deletions

View file

@ -790,6 +790,13 @@ fn gen_div_checked_by_zero_dec() {
);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
#[should_panic(expected = r#"Roc failed with message: "Decimal division by 0!"#)]
fn gen_div_dec_zero_by_zero() {
assert_evals_to!("0dec / 0", RocDec::from_str("-1").unwrap(), RocDec);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm", feature = "gen-dev"))]
#[should_panic(expected = r#"Roc failed with message: "Decimal division by 0!"#)]
@ -1809,6 +1816,7 @@ fn frac_is_nan() {
assert_evals_to!("Num.isNaN (0 / 0f64)", true, bool);
assert_evals_to!("Num.isNaN (1 / 0f64)", false, bool);
assert_evals_to!("Num.isNaN 42f64", false, bool);
assert_evals_to!("Num.isNaN 42dec", false, bool);
}
#[test]
@ -1818,6 +1826,7 @@ fn frac_is_infinite() {
assert_evals_to!("Num.isInfinite (-1 / 0f64)", true, bool);
assert_evals_to!("Num.isInfinite (0 / 0f64)", false, bool);
assert_evals_to!("Num.isInfinite 42f64", false, bool);
assert_evals_to!("Num.isInfinite 42dec", false, bool);
}
#[test]
@ -1826,6 +1835,7 @@ fn frac_is_finite() {
assert_evals_to!("Num.isFinite 42f64", true, bool);
assert_evals_to!("Num.isFinite (1 / 0f64)", false, bool);
assert_evals_to!("Num.isFinite (0 / 0f64)", false, bool);
assert_evals_to!("Num.isFinite 42dec", true, bool);
}
#[test]