From 499bf2c0a7166f632d3d1197db4de61325f0ec25 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Tue, 13 Oct 2026 01:05:06 -0400 Subject: [PATCH] Test: the uncached long TEXT() code stays under the 255-character cap Co-Authored-By: Claude Opus 5.5 --- crates/numfmt/src/tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/numfmt/src/tests.rs b/crates/numfmt/src/tests.rs index 98fb765..1fc83b9 100644 --- a/crates/numfmt/src/tests.rs +++ b/crates/numfmt/src/tests.rs @@ -777,8 +777,9 @@ fn parse_cache_is_bounded() { assert!(text_function(&Value::Number(1.0), "0.00\"0\"", S).is_ok()); assert_eq!(parse_cache::parses() - before, 1); - // A very long code is parsed on every call and not stored. - let long = format!("0\"{}\"", "x".repeat(parse_cache::MAX_CODE_LEN)); + // A code too long (in bytes) for the cache is parsed on every call and not stored. Two-byte + // characters keep it under the 255-character cap that TEXT() refuses past. + let long = format!("0\"{}\"", "é".repeat(parse_cache::MAX_CODE_LEN / 2 + 8)); let before = parse_cache::parses(); for _ in 0..3 { assert!(text_function(&Value::Number(1.0), &long, S).is_ok());