Merge pull request #4218 from roc-lang/rollup-10-05

Misc bugfixes 10-05
This commit is contained in:
Ayaz 2022-10-05 14:52:11 -05:00 committed by GitHub
commit 4f1d7fca9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 191 additions and 64 deletions

View file

@ -614,6 +614,25 @@ fn i64_abs() {
assert_evals_to!("Num.abs (Num.minI64 + 1)", -(i64::MIN + 1), i64);
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
fn various_sized_abs() {
assert_evals_to!("Num.abs -6i8", 6, i8);
assert_evals_to!("Num.abs -6i16", 6, i16);
assert_evals_to!("Num.abs -6i32", 6, i32);
assert_evals_to!("Num.abs -6i64", 6, i64);
if !cfg!(feature = "gen-wasm") {
assert_evals_to!("Num.abs -6i128", 6, i128);
}
assert_evals_to!("Num.abs 6u8", 6, u8);
assert_evals_to!("Num.abs 6u16", 6, u16);
assert_evals_to!("Num.abs 6u32", 6, u32);
assert_evals_to!("Num.abs 6u64", 6, u64);
if !cfg!(feature = "gen-wasm") {
assert_evals_to!("Num.abs 6u128", 6, u128);
}
}
#[test]
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
#[should_panic(