From afb6eca31f76e4eeb718044bcec4144f8784ba2b Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Tue, 13 Oct 2026 01:06:20 -0400 Subject: [PATCH] Test: drive the linear-time parse check through the uncapped parser Co-Authored-By: Claude Opus 5.5 --- crates/numfmt/src/tests.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/numfmt/src/tests.rs b/crates/numfmt/src/tests.rs index 1a66b52..e5687f5 100644 --- a/crates/numfmt/src/tests.rs +++ b/crates/numfmt/src/tests.rs @@ -825,7 +825,8 @@ fn format_codes_are_capped_at_255_characters() { fn finishes_in_time(code: String) -> String { let (tx, rx) = std::sync::mpsc::channel(); std::thread::spawn(move || { - let _ = tx.send(f(&code, 1234.5)); + // Uncapped: `parse` turns a code past 255 characters into General before the parser sees it. + let _ = tx.send(format_value(&Value::Number(1234.5), &NumberFormat::parse_uncapped(&code), S).text); }); rx.recv_timeout(std::time::Duration::from_secs(20)).expect("format code did not parse and render in time") }