diff options
Diffstat (limited to 'src/testcases')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java index b951ae3b62..a6ff9fd519 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java @@ -45,6 +45,7 @@ import org.apache.poi.hssf.record.formula.NumberPtg; import org.apache.poi.hssf.record.formula.PercentPtg; import org.apache.poi.hssf.record.formula.PowerPtg; import org.apache.poi.hssf.record.formula.Ptg; +import org.apache.poi.hssf.record.formula.RangePtg; import org.apache.poi.hssf.record.formula.Ref3DPtg; import org.apache.poi.hssf.record.formula.RefPtg; import org.apache.poi.hssf.record.formula.StringPtg; @@ -973,4 +974,26 @@ public final class TestFormulaParser extends TestCase { MemFuncPtg mf = (MemFuncPtg)ptgs[0]; assertEquals(45, mf.getLenRefSubexpression()); } + + public void testRange_bug46643() { + String formula = "Sheet1!A1:Sheet1!B3"; + HSSFWorkbook wb = new HSSFWorkbook(); + wb.createSheet("Sheet1"); + Ptg[] ptgs = FormulaParser.parse(formula, HSSFEvaluationWorkbook.create(wb)); + + if (ptgs.length == 3) { + confirmTokenClasses(ptgs, new Class[] { Ref3DPtg.class, Ref3DPtg.class, RangePtg.class,}); + throw new AssertionFailedError("Identified bug 46643"); + } + + Class [] expectedClasses = { + MemFuncPtg.class, + Ref3DPtg.class, + Ref3DPtg.class, + RangePtg.class, + }; + confirmTokenClasses(ptgs, expectedClasses); + MemFuncPtg mf = (MemFuncPtg)ptgs[0]; + assertEquals(15, mf.getLenRefSubexpression()); + } } |