mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-30 21:56:53 -06:00
Expand bit shift boundary regressions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user