Update of /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27481/tests/lexerTests
Modified Files:
LexerTests.java
Log Message:
Fix bug #899413 bug in javascript end detection.
Patch submitted by Gernot Fricke handles escaped quotes in strings when
lexing with smartquote turned on. Added test case in LexerTests.
Index: LexerTests.java
===================================================================
RCS file: /cvsroot/htmlparser/htmlparser/src/org/htmlparser/tests/lexerTests/LexerTests.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** LexerTests.java 24 Jan 2004 17:14:20 -0000 1.18
--- LexerTests.java 18 Feb 2004 12:34:04 -0000 1.19
***************
*** 789,792 ****
--- 789,815 ----
assertNull ("too many nodes", lexer.nextNode ());
}
+
+ /**
+ * See bug #899413 bug in javascript end detection.
+ */
+ public void testEscapedQuote () throws ParserException
+ {
+ String string;
+ String html;
+ Lexer lexer;
+ Node node;
+
+ string = "\na='\\'';\n";
+ html = string + "</script>";
+ lexer = new Lexer (html);
+ node = lexer.nextNode (true);
+ if (node == null)
+ fail ("too few nodes");
+ else
+ assertStringEquals ("bad string", string, node.toHtml());
+ assertNotNull ("too few nodes", lexer.nextNode (true));
+ assertNull ("too many nodes", lexer.nextNode (true));
+ }
+
}
|