This is an automated email from the ASF dual-hosted git repository.

centic9 pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 300c133ba3 Fix more tests after adjusting nesting checks in formula 
parsing
300c133ba3 is described below

commit 300c133ba303315307d648181197e63477faea8a
Author: Dominik Stadler <[email protected]>
AuthorDate: Sun Nov 1 18:19:18 2026 +0100

    Fix more tests after adjusting nesting checks in formula parsing
---
 poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParser.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParser.java 
b/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParser.java
index 49d966dfb2..4f24e8b0f1 100644
--- a/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParser.java
+++ b/poi/src/test/java/org/apache/poi/hssf/model/TestFormulaParser.java
@@ -1613,9 +1613,9 @@ final class TestFormulaParser {
     void testNestingDepthLimit() {
         int max = FormulaParser.DEFAULT_MAX_NESTING_DEPTH;
         assertEquals(max, FormulaParser.getMaxNestingDepth());
-        // sibling sub-expressions each get the full nesting allowance
-        assertEquals(2 * max + 3,
-            parseFormula("(".repeat(max) + "1" + ")".repeat(max) + "+" + 
"(".repeat(max) + "2" + ")".repeat(max)).length);
+        // sibling sub-expressions each get the nesting allowance for two 
places where nesting is limited
+        assertEquals(2 * max / 2 + 3,
+            parseFormula("(".repeat(max / 2) + "1" + ")".repeat(max / 2) + "+" 
+ "(".repeat(max / 2) + "2" + ")".repeat(max / 2)).length);
         assertEquals(max + 1, parseFormula("ABS(".repeat(max) + "1" + 
")".repeat(max)).length);
         assertThrows(FormulaParseException.class,
             () -> parseFormula("(".repeat(max + 1) + "1" + ")".repeat(max + 
1)));


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to