mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-30 05:37:00 -06:00
* 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
16 lines
518 B
Rust
16 lines
518 B
Rust
use gridcraft_formula::{Expr, parse, print};
|
|
|
|
#[test]
|
|
fn number_near_f64_max_round_trips() {
|
|
for src in ["=1.7976931348623157E308", "=-1.7976931348623157E308"] {
|
|
let e = parse(src).unwrap();
|
|
let printed = print(&e);
|
|
let back = parse(&printed).unwrap_or_else(|err| panic!("{printed}: {err:?}"));
|
|
assert_eq!(print(&back), printed);
|
|
match (&e, &back) {
|
|
(Expr::Number(a), Expr::Number(b)) => assert_eq!(a, b),
|
|
_ => assert_eq!(e, back),
|
|
}
|
|
}
|
|
}
|