[Htmlparser-cvs] htmlparser/src/org/htmlparser/tests/scannersTests ScriptScannerTest.java,1.49,1.50
Brought to you by:
derrickoswald
From: <der...@us...> - 2004-01-02 05:01:32
|
Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests In directory sc8-pr-cvs1:/tmp/cvs-serv27740/scannersTests Modified Files: ScriptScannerTest.java Log Message: Added testcases but was unable to reproduce the following bugs in the version 1.4 codebase: 839264 toHtml() parse error in Javascripts with "form" keyword 833592 DOCTYPE element is not parsed correctly 826764 ParserException occurs only when using setInputHTML() instea 825820 Words conjoined 825645 <input> not getting parsed inside table 813838 links not parsed correctly and #851882 zero length alt tag causes bug in ImageScanner #832530 empty attribute causes parser to fail #805598 attribute src in tag img sometimes not correctly parsed (these 3 are all the same bug, duplicates of the following): #753012 IMG SRC not parsed v1.3 & v1.4 #755929 Empty string attr. value causes attr parsing to be stopped #778781 SRC-attribute suppression in IMG-tags Also reviewed these test cases, again, with none reproducible in 1.4: #788746 parser crashes on comments like <!-- foobar --!> #772700 Jsp Tags are not parsed correctly when in quoted attributes. Index: ScriptScannerTest.java =================================================================== RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/scannersTests/ScriptScannerTest.java,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** ScriptScannerTest.java 8 Dec 2003 01:31:55 -0000 1.49 --- ScriptScannerTest.java 2 Jan 2004 05:01:28 -0000 1.50 *************** *** 37,40 **** --- 37,41 ---- import org.htmlparser.tags.ScriptTag; import org.htmlparser.tests.ParserTestCase; + import org.htmlparser.util.NodeIterator; import org.htmlparser.util.ParserException; *************** *** 558,561 **** --- 559,584 ---- } + /** + * See bug #839264 toHtml() parse error in Javascripts with "form" keyword + * Contributed by Ivan Wang (xj92wang) + */ + public void testScriptsWithForm () + throws + ParserException + { + String teststring = "<SCRIPT LANGUAGE=\"JAVASCRIPT\">" + + "function valForm(frm) { " + + " for (n=0; n<this.form.test; n++) this.form.nb++; "+ + "}"+ + "</SCRIPT>"; + StringBuffer htmlBuffer = new StringBuffer (); + createParser (teststring); + for (NodeIterator i = parser.elements (); i.hasMoreNodes ();) + { + Node tnode = i.nextNode (); + htmlBuffer.append (tnode.toHtml ()); + } + assertStringEquals ("bad html", teststring, htmlBuffer.toString ()); + } } |