Expand bit shift boundary regressions

This commit is contained in:
Harrison Booth
2026-10-30 19:39:26 -05:00
parent 5d89b9efdf
commit 213b76af10
+10 -3
View File
@@ -450,12 +450,19 @@ mod tests {
is_err(ev("BITLSHIFT", vec![n(1.0), n(54.0)]), CellError::Num);
is_err(ev("BITLSHIFT", vec![n(2f64.powi(47)), n(1.0)]), CellError::Num);
for f in ["BITLSHIFT", "BITRSHIFT"] {
for shift in [-100.0, -54.0, 54.0, 100.0] {
for shift in [-100.0, -54.0, -53.0, 53.0, 54.0, 100.0] {
close(ev(f, vec![n(0.0), n(shift)]), 0.0);
}
is_err(ev(f, vec![n(1.0), n(54.0)]), CellError::Num);
for shift in [-100.0, -54.0, 54.0, 100.0] {
is_err(ev(f, vec![n(1.0), n(shift)]), CellError::Num);
}
if f == "BITLSHIFT" {
is_err(ev(f, vec![n(1.0), n(53.0)]), CellError::Num);
} else {
close(ev(f, vec![n(1.0), n(53.0)]), 0.0);
}
is_err(ev(f, vec![n(0.0), t("bad")]), CellError::Value);
}
is_err(ev("BITLSHIFT", vec![n(0.0), t("bad")]), CellError::Value);
is_err(ev("BITRSHIFT", vec![n(-1.0), n(100.0)]), CellError::Num);
}