Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/utilTests
In directory sc8-pr-cvs1:/tmp/cvs-serv8877/src/org/htmlparser/tests/utilTests
Modified Files:
BeanTest.java
Log Message:
added some more BeanTests, including one that is Xed out, as I think it may uncover a bug
Index: BeanTest.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/utilTests/BeanTest.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** BeanTest.java 16 Jul 2003 00:17:23 -0000 1.30
--- BeanTest.java 16 Jul 2003 20:05:07 -0000 1.31
***************
*** 377,380 ****
--- 377,427 ----
check (sb, "<html><head></head><body>\t\t x</body></html>", "x");
}
+
+ /**
+ * Test text including a "pre" tag
+ */
+ public void testOutputWithPreTags() {
+ StringBean sb;
+ sb = new StringBean ();
+ String sampleCode = "public class Product {}";
+ check (sb, "<body><pre>"+sampleCode+"</pre></body>", sampleCode);
+ }
+
+ /**
+ * Test text including a "script" tag
+ */
+ public void testOutputWithScriptTags() {
+ StringBean sb;
+ sb = new StringBean ();
+
+ String sampleScript =
+ "<script language=\"javascript\">\r\n"
+ + "if(navigator.appName.indexOf(\"Netscape\") != -1)\r\n"
+ + " document.write ('xxx');\r\n"
+ + "else\r\n"
+ + " document.write ('yyy');\r\n"
+ + "</script>\r\n";
+
+ check (sb, "<body>"+sampleScript+"</body>", "");
+ }
+
+ /**
+ * Test output with pre and script tags
+ */
+ public void xtestOutputWithPreAndScriptTags() {
+ StringBean sb;
+ sb = new StringBean ();
+
+ String sampleScript =
+ "<script language=\"javascript\">\r\n"
+ + "if(navigator.appName.indexOf(\"Netscape\") != -1)\r\n"
+ + " document.write ('xxx');\r\n"
+ + "else\r\n"
+ + " document.write ('yyy');\r\n"
+ + "</script>\r\n";
+
+ check (sb, "<body><pre>"+sampleScript+"</pre></body>", sampleScript);
+ }
+
}
|