diff --git a/crates/functions/src/engineering.rs b/crates/functions/src/engineering.rs index a02196f41..96d73bf78 100644 --- a/crates/functions/src/engineering.rs +++ b/crates/functions/src/engineering.rs @@ -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); }