]> source.dussan.org Git - poi.git/commitdiff
Test a few more cases of function INDIRECT()
authorDominik Stadler <centic@apache.org>
Sun, 31 Jul 2016 17:19:33 +0000 (17:19 +0000)
committerDominik Stadler <centic@apache.org>
Sun, 31 Jul 2016 17:19:33 +0000 (17:19 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1754675 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/ss/formula/functions/TestIndirect.java

index 8e93152c81eb18fa2808e8e085d5709a56a02cae..ea5ac9c7aa5d1a1aa25ba0b777d86e49013d32fe 100644 (file)
@@ -27,6 +27,7 @@ import org.apache.poi.hssf.usermodel.HSSFRow;
 import org.apache.poi.hssf.usermodel.HSSFSheet;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.poi.ss.formula.eval.ErrorEval;
+import org.apache.poi.ss.formula.eval.ValueEval;
 import org.apache.poi.ss.usermodel.Cell;
 import org.apache.poi.ss.usermodel.CellType;
 import org.apache.poi.ss.usermodel.CellValue;
@@ -105,6 +106,7 @@ public final class TestIndirect {
 
         // non-error cases
         confirm(feA, c, "INDIRECT(\"C2\")", 23);
+        confirm(feA, c, "INDIRECT(\"C2\", TRUE)", 23);
         confirm(feA, c, "INDIRECT(\"$C2\")", 23);
         confirm(feA, c, "INDIRECT(\"C$2\")", 23);
         confirm(feA, c, "SUM(INDIRECT(\"Sheet2!B1:C3\"))", 351); // area ref
@@ -149,7 +151,7 @@ public final class TestIndirect {
 //            confirm(feA, c, "INDIRECT(\"Sheet1!A65537\")", ErrorEval.REF_INVALID); // bad row
 //        }
         confirm(feA, c, "INDIRECT(\"Sheet1!A 1\")", ErrorEval.REF_INVALID); // space in cell ref
-        
+
         wbA.close();
     }
 
@@ -203,4 +205,9 @@ public final class TestIndirect {
                     + "' but got '" + cv.formatAsString() + "'.");
         }
     }
+
+    @Test
+    public void testInvalidInput() {
+        assertEquals(ErrorEval.VALUE_INVALID, Indirect.instance.evaluate(new ValueEval[] {}, null));
+    }
 }