diff options
author | Avik Sengupta <avik@apache.org> | 2005-05-18 18:58:57 +0000 |
---|---|---|
committer | Avik Sengupta <avik@apache.org> | 2005-05-18 18:58:57 +0000 |
commit | 4873d89d329a93efff5e3a5854bc76d651b74526 (patch) | |
tree | 0ec1b36cd122a6790a9de4604dbb0c62d40850f3 /src/testcases | |
parent | 10eddec1fd6eb1ae63ebde7c3c8c55b0e9ae0d12 (diff) | |
download | poi-4873d89d329a93efff5e3a5854bc76d651b74526.tar.gz poi-4873d89d329a93efff5e3a5854bc76d651b74526.zip |
unary plus: patch by Amol Deshmukh, test added
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353685 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/testcases')
-rw-r--r-- | src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java index ec840ba3b9..1e69ce0ed3 100644 --- a/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java +++ b/src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java @@ -36,6 +36,7 @@ import org.apache.poi.hssf.record.formula.Ptg; import org.apache.poi.hssf.record.formula.ReferencePtg; import org.apache.poi.hssf.record.formula.StringPtg; import org.apache.poi.hssf.record.formula.UnaryMinusPtg; +import org.apache.poi.hssf.record.formula.UnaryPlusPtg; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; @@ -323,7 +324,17 @@ public class TestFormulaParser extends TestCase { Ptg[] ptg = fp.getRPNPtg(); assertTrue("got 2 ptgs", ptg.length == 2); assertTrue("first ptg is reference",ptg[0] instanceof ReferencePtg); - assertTrue("second ptg is string",ptg[1] instanceof UnaryMinusPtg); + assertTrue("second ptg is Minus",ptg[1] instanceof UnaryMinusPtg); + } + + public void testUnaryPlus() + { + FormulaParser fp = new FormulaParser("+A1", null); + fp.parse(); + Ptg[] ptg = fp.getRPNPtg(); + assertTrue("got 2 ptgs", ptg.length == 2); + assertTrue("first ptg is reference",ptg[0] instanceof ReferencePtg); + assertTrue("second ptg is Plus",ptg[1] instanceof UnaryPlusPtg); } public void testLeadingSpaceInString() |