From 2829120d4dd7ef54db7aa5afa6c44d5e1b464b32 Mon Sep 17 00:00:00 2001 From: kezmdor <15539254+kezmdor@users.noreply.github.com> Date: Sat, 7 Nov 2026 14:24:10 +0100 Subject: [PATCH] Recently Used: a sign before a space starts a formula too main's `functions_in_formula` test expected `- SUM(1)` not to be a formula. With #2023's rule, which `is_formula_input` now uses, it is one, as Excel for the web enters `- remember this` as `=- remember this`. --- crates/engine/src/recent.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/recent.rs b/crates/engine/src/recent.rs index 0a1bba2dc2..2bd8a375cb 100644 --- a/crates/engine/src/recent.rs +++ b/crates/engine/src/recent.rs @@ -154,7 +154,9 @@ mod tests { assert_eq!(functions_in_formula("+SUM(1)"), ["SUM"]); assert_eq!(functions_in_formula("-ABS(A1)"), ["ABS"]); assert!(functions_in_formula("-5").is_empty() && functions_in_formula("+1e3").is_empty(), "numbers"); - assert!(functions_in_formula("+").is_empty() && functions_in_formula("- SUM(1)").is_empty(), "not formulas"); + assert!(functions_in_formula("+").is_empty() && functions_in_formula("--").is_empty(), "not formulas"); + // A sign before a space still starts a formula, as Excel takes `- SUM(1)` (#2023). + assert_eq!(functions_in_formula("- SUM(1)"), ["SUM"]); } #[test]