Files
gridcraft/crates/engine/tests/it/offset_overflow.rs
T
aiongg a7608ada6d CI: one test binary per crate, nextest, line tables only (#2372)
* CI: dev builds keep line tables only

* CI: one integration-test binary per crate

* CI: xtask runs tests with nextest, doctests apart, --keep-going on clippy and wasm

cargo xtask test runs the workspace tests (--lib --bins --tests) with cargo-nextest when it is installed, else cargo test, then the doctests. cargo xtask ci uses the same two steps.

* CI: docs name cargo xtask test

* CI: agent guides name the moved fuzz test

* CI: tests added on main join their crate's test binary
2026-10-23 12:59:46 -04:00

25 lines
835 B
Rust

use gridcraft_core::{CellError, CellRef, Value};
use gridcraft_engine::Session;
use serde_json::json;
#[test]
fn cell_set_offset_extreme_arguments_return_ref() {
let mut session = Session::new();
session.new_workbook();
for formula in [
"=OFFSET(B2,1E300,0)",
"=OFFSET(B2,0,1E300)",
"=OFFSET(B2,0,0,1E300,1)",
"=OFFSET(B2,0,0,1,1E300)",
"=OFFSET(B2,-1E300,0)",
"=OFFSET(B2,0,-1E300)",
"=OFFSET(B2,0,0,-1E300,1)",
"=OFFSET(B2,0,0,1,-1E300)",
"=OFFSET(B2,1E300,0,-1E300,1)",
"=OFFSET(B2,0,1E300,1,-1E300)",
] {
session.execute("cell.set", json!({"cell": "D1", "input": formula})).unwrap();
assert_eq!(session.doc().unwrap().wb.sheet(0).unwrap().value(CellRef::new(0, 3)), Value::Error(CellError::Ref), "{formula}");
}
}