[Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/tagTests TagTest.java,1.24,1.25
Brought to you by:
derrickoswald
From: <der...@us...> - 2003-05-21 11:13:37
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests In directory sc8-pr-cvs1:/tmp/cvs-serv12190/org/htmlparser/tests/tagTests Modified Files: TagTest.java Log Message: See bug #741026 registerScanners() mangles output HTML badly. Seems to work in the current 1.3 code base. Index: TagTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/tagTests/TagTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** TagTest.java 19 May 2003 02:50:00 -0000 1.24 --- TagTest.java 21 May 2003 11:13:34 -0000 1.25 *************** *** 656,658 **** --- 656,679 ---- assertStringEquals("Resolved Link","http://cbc.ca", href); } + + /** + * See bug #741026 registerScanners() mangles output HTML badly. + */ + public void testHTMLOutputOfDifficultLinksWithRegisterScanners () throws ParserException + { + // straight out of a real world example + createParser ("<a href=http://www.google.com/webhp?hl=en>"); + // register standard scanners (Very Important) + parser.registerScanners (); + String temp = null; + for (NodeIterator e = parser.elements (); e.hasMoreNodes ();) + { + Node newNode = e.nextNode (); // Get the next HTML Node + temp = newNode.toHTML (); + } + assertNotNull ("No nodes", temp); + assertEquals ("Incorrect HTML output: ", + "<A HREF=\"http://www.google.com/webhp?hl=en\"></A>", + temp); + } } |