]> source.dussan.org Git - poi.git/commitdiff
testcases for bug 23094
authorAvik Sengupta <avik@apache.org>
Tue, 23 Sep 2003 18:47:12 +0000 (18:47 +0000)
committerAvik Sengupta <avik@apache.org>
Tue, 23 Sep 2003 18:47:12 +0000 (18:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353370 13f79535-47bb-0310-9956-ffa450edef68

src/testcases/org/apache/poi/hssf/model/TestFormulaParser.java
src/testcases/org/apache/poi/hssf/usermodel/TestBugs.java

index dadab580c82019b274be0fdd923fe5f8a4bd5114..a409e4b2ab37e66c5e280e3dc1d5ef87b717215d 100644 (file)
@@ -297,6 +297,15 @@ public class TestFormulaParser extends TestCase {
         assertEquals("FOO", tname.toFormulaString(w));
     }
 
+    public void testEmbeddedSlash() {
+        FormulaParser fp = new FormulaParser("HYPERLINK(\"http://www.jakarta.org\",\"Jakarta\");",null);
+        fp.parse();
+        Ptg[] ptg = fp.getRPNPtg();
+        for (int i=0;i<ptg.length;i++) {System.out.println(ptg[i]);}
+        assertTrue("first ptg is string",ptg[0] instanceof StringPtg);
+        assertTrue("second ptg is string",ptg[1] instanceof StringPtg);
+
+    }
      public static void main(String [] args) {
         System.out.println("Testing org.apache.poi.hssf.record.formula.FormulaParser");
         junit.textui.TestRunner.run(TestFormulaParser.class);
index 487c123f91f3766562dc151fc0b13fd5f02e341a..1e35b5d9591a774b719e5712e219f39d69749f7e 100644 (file)
@@ -109,7 +109,19 @@ extends TestCase {
 
     }
    
-}
     
 
+                 public void test23094() throws Exception {
+                     File file = File.createTempFile("test23094",".xls");
+        FileOutputStream out    = new FileOutputStream(file);
+        HSSFWorkbook     wb     = new HSSFWorkbook();
+        HSSFSheet        s      = wb.createSheet();
+        HSSFRow r = s.createRow(0);
+        r.createCell((short)0).setCellFormula("HYPERLINK( \"http://jakarta.apache.org\", \"Jakarta\" )");
+                 assertTrue("No Exception expected",true);
+                 wb.write(out);
+                 out.close();
+                 }
+
 
+}