)
parsetests = [
# start tags
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""< a>""", """"""),
("""< a >""", """"""),
("""<>""", """<>"""),
("""< >""", """< >"""),
# reduce test
("""<""", """<"""),
("""d>""", """d>"""),
# numbers in tag
("""bla
""", """bla
"""),
# more start tags
("""""", """"""),
("""""", """"""),
("""
""", """
"""),
("""
""", """
"""),
("""
""", """
"""),
# comments
("""< 1>""", """<1>"""),
("""< 2>""", """<2>"""),
("""< 3>""", """<3>"""),
("""< 4>""", """<4>"""),
("""< 5>""", """<5>"""),
("""<6>"""),
("""< 7>""", """<7>"""),
("""<8>"""),
("""""", """"""),
("""< 9>""", """<9>"""),
("""< 10>""", """<10>"""),
# end tags
("""""", """"""),
(""" a>""", """"""),
(""" a >""", """"""),
("""""", """"""),
("""< / a>""", """"""),
("""< /a>""", """"""),
# missing > in end tag
("""""", """"""),
# start and end tag (HTML doctype assumed)
("""""", """"""),
("""""", """"""),
("""""", """"""),
# declaration tags
("""""",
""""""),
# misc
("""""",
""""""),
# javascript
("""""", """"""),
("""""",
""""""),
# line continuation (Dr. Fun webpage)
(" ", """ """),
# href with $
("""""", """"""),
# quoting
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""", """"""),
("""""",
""""""),
("""""",
""""""),
# entity resolving
("""""", """"""),
# non-ascii characters
("""<Üzgür> fahr ¹²³¼½¬{""",
"""<Üzgür> fahr ¹²³¼½¬{"""),
# mailto link
("""1""",
"""1"""),
# doctype XHTML
("""""",
""""""),
]
flushtests = [
("<", "<"),
(" |