From 14656c49515dbdcc3c8130d1a1a46d47dff97dbf Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 3 Feb 2022 13:05:40 +0000 Subject: [PATCH] [bug-62857] support locale git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897725 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java | 4 +++- .../poi/ss/formula/eval/TestFormulasFromSpreadsheet.java | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java index c471832703..bb7df1b287 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestFormulaEvaluatorOnXSSF.java @@ -170,6 +170,9 @@ public final class TestFormulaEvaluatorOnXSSF { @ParameterizedTest @MethodSource("data") void processFunctionRow(String targetFunctionName, int formulasRowIdx, int expectedValuesRowIdx) { + //DOLLAR function returns a string that is locale specific + assumeFalse(targetFunctionName.equalsIgnoreCase("DOLLAR")); + Row formulasRow = sheet.getRow(formulasRowIdx); Row expectedValuesRow = sheet.getRow(expectedValuesRowIdx); @@ -180,7 +183,6 @@ public final class TestFormulaEvaluatorOnXSSF { Cell c = formulasRow.getCell(colnum); assumeTrue(c != null); assumeTrue(c.getCellType() == CellType.FORMULA); - assumeFalse(targetFunctionName.equalsIgnoreCase("DOLLAR")); ignoredFormulaTestCase(c.getCellFormula()); CellValue actValue = evaluator.evaluate(c); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java index fc8d0b98af..4c22725b1e 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/eval/TestFormulasFromSpreadsheet.java @@ -21,6 +21,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.api.Assumptions.assumeFalse; import java.util.ArrayList; import java.util.List; @@ -152,6 +153,9 @@ public final class TestFormulasFromSpreadsheet { @ParameterizedTest @MethodSource("data") void processFunctionRow(String targetFunctionName, int formulasRowIdx, int expectedValuesRowIdx) { + //DOLLAR function returns a string that is locale specific + assumeFalse(targetFunctionName.equalsIgnoreCase("DOLLAR")); + Row formulasRow = sheet.getRow(formulasRowIdx); Row expectedValuesRow = sheet.getRow(expectedValuesRowIdx);