diff --git a/linkcheck/tests/test_parser.py b/linkcheck/tests/test_parser.py index e912e0e1..06bb4fc0 100644 --- a/linkcheck/tests/test_parser.py +++ b/linkcheck/tests/test_parser.py @@ -27,129 +27,131 @@ from linkcheck.tests import MsgTestCase # list of tuples -# (, , ) +# (, ) parsetests = [ # start tags - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 1), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""< a>""", """""", 0), - ("""< a >""", """""", 0), - ("""<>""", """<>""", 0), - ("""< >""", """< >""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""< a>""", """"""), + ("""< a >""", """"""), + ("""<>""", """<>"""), + ("""< >""", """< >"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), # reduce test - ("""<""", """<""", 0), - ("""d>""", """d>""", 0), + ("""<""", """<"""), + ("""d>""", """d>"""), # numbers in tag - ("""

bla

""", """

bla

""", 0), + ("""

bla

""", """

bla

"""), # more start tags - ("""
""", """""", 1), - ("""
""", """
""", 0), - ("""
""", """
""", 0), - ("""
""", """

""", 0), + ("""
""", """"""), + ("""
""", """
"""), + ("""
""", """
"""), + ("""
""", """

"""), # comments - ("""< 1>""", """<1>""", 0), - ("""< 2>""", """<2>""", 0), - ("""< 3>""", """<3>""", 0), - ("""< 4>""", """<4>""", 0), - ("""< 5>""", """<5>""", 0), - ("""< 7>""", """<7>""", 0), - ("""""", """""", 0), - ("""< 9>""", """<9>""", 0), - ("""< 10>""", """<10>""", 0), + ("""< 1>""", """<1>"""), + ("""< 2>""", """<2>"""), + ("""< 3>""", """<3>"""), + ("""< 4>""", """<4>"""), + ("""< 5>""", """<5>"""), + ("""< 7>""", """<7>"""), + ("""""", """"""), + ("""< 9>""", """<9>"""), + ("""< 10>""", """<10>"""), # invalid comments - ("""<8>""", 1), - ("""<6>""", 1), - ("""""", """""", 1), - ("""""", 1), - ("""""", """""", 2), - ("""""", """""", 1), - ("""""", 1), + ("""<8>"""), + ("""<6>"""), + ("""""", """"""), + (""""""), + ("""""", """"""), + ("""""", """"""), + (""""""), # end tags - ("""
""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""< / a>""", """""", 0), - ("""< /a>""", """""", 0), - ("""""", """""", 0), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""< / a>""", """"""), + ("""< /a>""", """"""), + ("""""", """"""), # start and end tag (HTML doctype assumed) - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), # declaration tags ("""""", - """""", 0), + """"""), # misc ("""""", - """""", 0), + """"""), # javascript - ("""""", """""", 0), + ("""""", """"""), ("""""", - """""", 0), + """"""), # line continuation (Dr. Fun webpage) - ("", """""", 1), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), # href with $ - ("""""", """""", 0), + ("""""", """"""), # quoting - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 0), - ("""""", """""", 1), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), + ("""""", """"""), ("""""", """""", 0), + """'/images/dwnavpoint_over.gif',1);movein(this);" b="c">"""), ("""""", - """""", 0), + """"""), # entity resolving - ("""""", """""", 0), + ("""""", """"""), # non-ascii characters ("""<Üzgür> fahr ¹²³¼½¬{""", - """<Üzgür> fahr ¹²³¼½¬{""", 0), + """<Üzgür> fahr ¹²³¼½¬{"""), # mailto link ("""1""", - """1""", 0), + """1"""), # doctype XHTML ("""""", - """""", 0), + """"""), # missing > in end tag - ("""""", """""", 1), - ("""""", """""", 1), + ("""""", """"""), + ("""""", """"""), # missing beginning quote - ("""""", """""", 1), - # missing end quote (TODO) - #("""""", 1), - #("""""", 1), - #("""""", """""", 1), - #("""""", """""", 1), + ("""""", """"""), + # missing end quote (XXX TODO) + #("""\n"""), + #("""\na"""), + #("""\n""", """\n"""), + #("""\n""", """\n"""), ] flushtests = [ - ("<", "<", 0), - ("