mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-01 06:36:47 -06:00
Found while testing crates/formula/src/printer.rs:134 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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),
|
|
}
|
|
}
|
|
}
|