mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-05 18:18:55 +00:00
Expand bit shift boundary regressions
This commit is contained in:
1 parent
5d89b9efdf
commit
213b76af10
1 file changed
+10
-3
@@ -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