From b25667373a9c52510f0411bd3a689d0a6d14b791 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 21 Feb 2022 13:05:00 +0000 Subject: [PATCH] add tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898272 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/ss/formula/functions/TestIndirect.java | 4 ++++ .../org/apache/poi/ss/formula/functions/TestSumproduct.java | 1 + 2 files changed, 5 insertions(+) diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirect.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirect.java index 6e670ec52f..c8a58803e6 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirect.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestIndirect.java @@ -124,8 +124,12 @@ final class TestIndirect { confirm(feA, c, "SUM(INDIRECT(A4))", 50); // indirect defined name confirm(feA, c, "SUM(INDIRECT(B4))", 351); // indirect defined name pointinh to other sheet + // simple error propagation: + confirm(feA, c, "INDIRECT(\"C\")", ErrorEval.REF_INVALID); + confirm(feA, c, "INDIRECT(\"4\")", ErrorEval.REF_INVALID); + // arg0 is evaluated to text first confirm(feA, c, "INDIRECT(#DIV/0!)", ErrorEval.DIV_ZERO); confirm(feA, c, "INDIRECT(#DIV/0!)", ErrorEval.DIV_ZERO); diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java index 18db6cdbec..b311d055b8 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java @@ -133,6 +133,7 @@ final class TestSumproduct { HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb); HSSFCell cell = wb.getSheetAt(0).getRow(0).createCell(100); assertDouble(fe, cell, "SUMPRODUCT(C2:C5,D2:D5)", 78.97); + assertDouble(fe, cell, "SUMPRODUCT(C2:C5=\"Chai\",D2:D5)", 78.97); } } -- 2.39.5