]> source.dussan.org Git - poi.git/commitdiff
add disabled test case
authorPJ Fanning <fanningpj@apache.org>
Mon, 21 Feb 2022 10:25:02 +0000 (10:25 +0000)
committerPJ Fanning <fanningpj@apache.org>
Mon, 21 Feb 2022 10:25:02 +0000 (10:25 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898269 13f79535-47bb-0310-9956-ffa450edef68

poi/src/test/java/org/apache/poi/ss/formula/functions/TestSumproduct.java

index 00133bc3235ba53e5ba48f0182d7ab9825dfc710..18db6cdbecf09c654d8274080f8157b5827214f9 100644 (file)
@@ -32,6 +32,7 @@ import org.apache.poi.ss.formula.eval.NumberEval;
 import org.apache.poi.ss.formula.eval.NumericValueEval;
 import org.apache.poi.ss.formula.eval.RefEval;
 import org.apache.poi.ss.formula.eval.ValueEval;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 /**
@@ -135,6 +136,17 @@ final class TestSumproduct {
         }
     }
 
+    @Disabled("https://bz.apache.org/bugzilla/show_bug.cgi?id=65907")
+    @Test
+    void testMicrosoftExample3() throws Exception {
+        //https://support.microsoft.com/en-us/office/sumproduct-function-16753e75-9f68-4874-94ac-4d2145a2fd2e
+        try (HSSFWorkbook wb = initWorkbook3()) {
+            HSSFFormulaEvaluator fe = new HSSFFormulaEvaluator(wb);
+            HSSFCell cell = wb.getSheetAt(0).getRow(11).createCell(3);
+            assertDouble(fe, cell, "SUMPRODUCT((B2:B9=B12)*(C2:C9=C12)*D2:D9)", 5249);
+        }
+    }
+
     private HSSFWorkbook initWorkbook1() {
         HSSFWorkbook wb = new HSSFWorkbook();
         HSSFSheet sheet = wb.createSheet();
@@ -145,4 +157,22 @@ final class TestSumproduct {
         addRow(sheet, 4, null, "Ginger", 3.62, 6);
         return wb;
     }
+
+    private HSSFWorkbook initWorkbook3() {
+        HSSFWorkbook wb = new HSSFWorkbook();
+        HSSFSheet sheet = wb.createSheet();
+        addRow(sheet, 0, null , "Region", "Item", "Sales");
+        addRow(sheet, 1, null, "North", "Apples", 2763);
+        addRow(sheet, 2, null, "South", "Pears", 9359);
+        addRow(sheet, 3, null, "East", "Cherries", 3830);
+        addRow(sheet, 4, null, "West", "Bananas", 8720);
+        addRow(sheet, 5, null, "North", "Pears", 1873);
+        addRow(sheet, 6, null, "South", "Apples", 4065);
+        addRow(sheet, 7, null, "East", "Cherries", 1419);
+        addRow(sheet, 8, null, "West", "Bananas", 7173);
+        addRow(sheet, 9);
+        addRow(sheet, 10, null , "Region", "Item", "Sales");
+        addRow(sheet, 11, null , "East", "Cherries");
+        return wb;
+    }
 }