[Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/scannersTests TableScannerTest.java,1.19,1.20
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-05-24 10:15:08
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests In directory sc8-pr-cvs1:/tmp/cvs-serv8838/org/htmlparser/tests/scannersTests Modified Files: TableScannerTest.java Log Message: Fixed bug #742254 Nested <TR> &<TD> tags should not be allowed. Index: TableScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/TableScannerTest.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TableScannerTest.java 19 May 2003 02:49:59 -0000 1.19 --- TableScannerTest.java 24 May 2003 10:15:04 -0000 1.20 *************** *** 133,135 **** --- 133,171 ---- } } + + /** + * See bug #742254 Nested <TR> &<TD> tags should not be allowed + */ + public void testUnClosed1 () throws ParserException + { + createParser ("<TABLE><TR><TR></TR></TABLE>"); + parser.registerScanners (); + parseAndAssertNodeCount (1); + String s = node[0].toHtml (); + assertEquals ("Unclosed","<TABLE><TR></TR><TR></TR></TABLE>",s); + } + + /** + * See bug #742254 Nested <TR> &<TD> tags should not be allowed + */ + public void testUnClosed2 () throws ParserException + { + createParser ("<TABLE><TR><TD><TD></TD></TR></TABLE>"); + parser.registerScanners (); + parseAndAssertNodeCount (1); + String s = node[0].toHtml (); + assertEquals ("Unclosed","<TABLE><TR><TD></TD><TD></TD></TR></TABLE>",s); + } + + /** + * See bug #742254 Nested <TR> &<TD> tags should not be allowed + */ + public void testUnClosed3 () throws ParserException + { + createParser ("<TABLE><TR><TD>blah blah</TD><TR><TD>blah blah</TD></TR></TABLE>"); + parser.registerScanners (); + parseAndAssertNodeCount (1); + String s = node[0].toHtml (); + assertEquals ("Unclosed","<TABLE><TR><TD>blah blah</TD></TR><TR><TD>blah blah</TD></TR></TABLE>",s); + } } |