mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Fix Num.shiftRight* tests
This commit is contained in:
parent
9fb3549c24
commit
46fc305d56
1 changed files with 4 additions and 4 deletions
|
@ -1845,7 +1845,7 @@ fn shift_left_by() {
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
fn shift_right_by() {
|
fn shift_right_by() {
|
||||||
// Sign Extended Right Shift
|
// Sign Extended Right Shift
|
||||||
assert_evals_to!("Num.shiftRightBy 0 0b0100_0000i8", 0b0001_0000, i8);
|
assert_evals_to!("Num.shiftRightBy 2 0b0100_0000i8", 0b0001_0000, i8);
|
||||||
assert_evals_to!("Num.shiftRightBy 1 0b1110_0000u8", 0b1111_0000u8 as i8, i8);
|
assert_evals_to!("Num.shiftRightBy 1 0b1110_0000u8", 0b1111_0000u8 as i8, i8);
|
||||||
assert_evals_to!("Num.shiftRightBy 2 0b1100_0000u8", 0b1111_0000u8 as i8, i8);
|
assert_evals_to!("Num.shiftRightBy 2 0b1100_0000u8", 0b1111_0000u8 as i8, i8);
|
||||||
}
|
}
|
||||||
|
@ -1854,9 +1854,9 @@ fn shift_right_by() {
|
||||||
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))]
|
||||||
fn shift_right_zf_by() {
|
fn shift_right_zf_by() {
|
||||||
// Logical Right Shift
|
// Logical Right Shift
|
||||||
assert_evals_to!("Num.shiftRightBy 1 0b1100_0000u8", 0b0011_0000, i64);
|
assert_evals_to!("Num.shiftRightZfBy 2 0b1100_0000u8", 0b0011_0000, i64);
|
||||||
assert_evals_to!("Num.shiftRightBy 2 0b0000_0010u8", 0b0000_0001, i64);
|
assert_evals_to!("Num.shiftRightZfBy 1 0b0000_0010u8", 0b0000_0001, i64);
|
||||||
assert_evals_to!("Num.shiftRightBy 3 0b0000_1100u8", 0b0000_0011, i64);
|
assert_evals_to!("Num.shiftRightZfBy 2 0b0000_1100u8", 0b0000_0011, i64);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue