Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25265/tests/tagTests
Modified Files:
InputTagTest.java
Log Message:
Fix bug# 919738 Text has not been extracted correctly using StringBean
and (duplicate) bug #936392 ScriptTag visitor fails for comments with '
by handling single and multiline ecmascript comments in the Lexer class
when called with quotesmart true.
Also added test cases for, but didn't fix bug #923146 tag nesting rule
too strict for forms (org.htmlparser.tests.tagTests.InputTagTest.testTable)
and bug #922439 OutOfMemory on huge HTML files (4,7MB)
(org.htmlparser.tests.MemoryTest) which are thus currently failing.
Index: InputTagTest.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/InputTagTest.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** InputTagTest.java 2 Jan 2004 16:24:57 -0000 1.39
--- InputTagTest.java 22 May 2004 03:57:31 -0000 1.40
***************
*** 27,31 ****
--- 27,35 ----
package org.htmlparser.tests.tagTests;
+ import org.htmlparser.tags.FormTag;
import org.htmlparser.tags.InputTag;
+ import org.htmlparser.tags.TableColumn;
+ import org.htmlparser.tags.TableRow;
+ import org.htmlparser.tags.TableTag;
import org.htmlparser.tests.ParserTestCase;
import org.htmlparser.util.ParserException;
***************
*** 82,84 ****
--- 86,124 ----
assertEquals("Name","Google",inputTag.getAttribute("NAME"));
}
+
+ /**
+ * Bug #923146 tag nesting rule too strict for forms
+ */
+ public void testTable () throws ParserException
+ {
+ String html =
+ "<table>" +
+ "<tr>" +
+ "<td>" +
+ "<form>" +
+ "<input name=input1>" +
+ "</td>" +
+ // <tr> missing
+ "<tr>" +
+ "<td>" +
+ "<input name=input2>" +
+ "</td>" +
+ "</tr>" +
+ "</form>" +
+ "</table>";
+ createParser (html);
+ parseAndAssertNodeCount (1);
+ assertTrue ("not a table", node[0] instanceof TableTag);
+ TableTag table = (TableTag)node[0];
+ assertTrue ("not two rows", 2 == table.getRowCount ());
+ // assertTrue ("not one row", 1 == table.getRowCount ());
+ TableRow row = table.getRow (0);
+ assertTrue ("not one column", 1 == row.getColumnCount ());
+ TableColumn column = row.getColumns ()[0];
+ assertTrue ("not one child", 1 == column.getChildCount ());
+ assertTrue ("column doesn't have a form", column.getChild (0) instanceof FormTag);
+ FormTag form = (FormTag)column.getChild (0);
+ assertTrue ("form only has one input field", 2 == form.getFormInputs ().size ());
+ }
+
}
\ No newline at end of file
|