Skip to content

Add tests for line breaks in the comment end bang state #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions tokenizer/test3.test
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,34 @@
{ "code": "incorrectly-closed-comment", "line": 1, "col": 8 }
]},

{"description":"<!----! >",
"input":"<!----! >",
"output":[["Comment", "--! >"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 9 }
]},

{"description":"<!----!LF>",
"input":"<!----!\n>",
"output":[["Comment", "--!\n>"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 9 }
]},

{"description":"<!----!CR>",
"input":"<!----!\r>",
"output":[["Comment", "--!\n>"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 9 }
]},

{"description":"<!----!CRLF>",
"input":"<!----!\r\n>",
"output":[["Comment", "--!\n>"]],
"errors":[
{ "code": "eof-in-comment", "line": 1, "col": 9 }
]},

{"description":"<!----!a",
"input":"<!----!a",
"output":[["Comment", "--!a"]],
Expand Down
10 changes: 7 additions & 3 deletions tree-construction/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,13 @@ final newline (on the last line) removed.
Then there must be a line that says "\#errors". It must be followed by
one line per parse error that a conformant checker would return. It
doesn't matter what those lines are, although they can't be
"\#document-fragment", "\#document", "\#script-off", "\#script-on", or
empty, the only thing that matters is that there be the right number
of parse errors.
"\#new-errors", "\#document-fragment", "\#document", "\#script-off",
"\#script-on", or empty, the only thing that matters is that there be
the right number of parse errors.

Then there \*may\* be a line that says "\#new-errors", which works like
the "\#errors" section adding more errors to the expected number of
errors.

Then there \*may\* be a line that says "\#document-fragment", which must
be followed by a newline (LF), followed by a string of characters that
Expand Down
28 changes: 28 additions & 0 deletions tree-construction/comments01.dat
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@ FOO<!-- BAR --!>BAZ
| <!-- BAR -->
| "BAZ"

#data
FOO<!-- BAR --! >BAZ
#errors
(1,3): expected-doctype-but-got-chars
#new-errors
(1:20) eof-in-comment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be (1:21)

#document
| <html>
| <head>
| <body>
| "FOO"
| <!-- BAR --! >BAZ -->

#data
FOO<!-- BAR --!
>BAZ
#errors
(1,3): expected-doctype-but-got-chars
#new-errors
(1:20) eof-in-comment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it was copied from above. It should be (2:5)

#document
| <html>
| <head>
| <body>
| "FOO"
| <!-- BAR --!
>BAZ -->

#data
FOO<!-- BAR -- >BAZ
#errors
Expand Down