8000 Add tests for line breaks in the comment end bang state · html5lib/html5lib-tests@4fffa16 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4fffa16

Browse files
committed
Add tests for line breaks in the comment end bang state
1 parent a1dcff0 commit 4fffa16

File tree

3 files changed

+63
-3
lines changed

3 files changed

+63
-3
lines changed

tokenizer/test3.test

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,34 @@
954954
{ "code": "incorrectly-closed-comment", "line": 1, "col": 8 }
955955
]},
956956

957+
{"description":"<!----! >",
958+
"input":"<!----! >",
959+
"output":[["Comment", "--! >"]],
960+
"errors":[
961+
{ "code": "incorrectly-closed-comment", "line": 1, "col": 8 }
962+
]},
963+
964+
{"description":"<!----!LF>",
965+
"input":"<!----!\n>",
966+
"output":[["Comment", "--!\n>"]],
967+
"errors":[
968+
{ "code": "incorrectly-closed-comment", "line": 1, "col": 8 }
969+
]},
970+
971+
{"description":"<!----!CR>",
972+
"input":"<!----!\r>",
973+
"output":[["Comment", "--!\n>"]],
974+
"errors":[
975+
{ "code": "incorrectly-closed-comment", "line": 1, "col": 8 }
976+
]},
977+
978+
{"description":"<!----!CRLF>",
979+
"input":"<!----!\r\n>",
980+
"output":[["Comment", "--!\n>"]],
981+
"errors":[
982+
{ "code": "incorrectly-closed-comment", "line": 1, "col": 8 }
983+
]},
984+
957985
{"description":"<!----!a",
958986
"input":"<!----!a",
959987
"output":[["Comment", "--!a"]],

tree-construction/README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,13 @@ final newline (on the last line) removed.
2121
Then there must be a line that says "\#errors". It must be followed by
2222
one line per parse error that a conformant checker would return. It
2323
doesn't matter what those lines are, although they can't be
24-
"\#document-fragment", "\#document", "\#script-off", "\#script-on", or
25-
empty, the only thing that matters is that there be the right number
26-
of parse errors.
24+
"\#new-errors", "\#document-fragment", "\#document", "\#script-off",
25+
"\#script-on", or empty, the only thing that matters is that there be
26+
the right number of parse errors.
27+
28+
Then there \*may\* be a line that says "\#new-errors", which works like
29+
the "\#errors" section adding more errors to the expected number of
30+
errors.
2731

2832
Then there \*may\* be a line that says "\#document-fragment", which must
2933
be followed by a newline (LF), followed by a string of characters that

tree-construction/comments01.dat

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,34 @@ FOO<!-- BAR --!>BAZ
2525
| <!-- BAR -->
2626
| "BAZ"
2727

28+
#data
29+
FOO<!-- BAR --! >BAZ
30+
#errors
31+
(1,3): expected-doctype-but-got-chars
32+
#new-errors
33+
(1:20) incorrectly-closed-comment
34+
#document
35+
| <html>
36+
| <head>
37+
| <body>
38+
| "FOO"
39+
| <!-- BAR --! >BAZ -->
40+
41+
#data
42+
FOO<!-- BAR --!
43+
>BAZ
44+
#errors
45+
(1,3): expected-doctype-but-got-chars
46+
#new-errors
47+
(1:20) incorrectly-closed-comment
48+
#document
49+
| <html>
50+
| <head>
51+
| <body>
52+
| "FOO"
53+
| <!-- BAR --!
54+
>BAZ -->
55+
2856
#data
2957
FOO<!-- BAR -- >BAZ
3058
#errors

0 commit comments

Comments
 (0)
0