Skip to content

Add a bunch more tests for annotation-xml #80

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
Jul 6, 2016
Merged
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
67 changes: 67 additions & 0 deletions tree-construction/tests20.dat
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,70 @@
| <math annotation-xml>
| encoding=" text/html "
| <div>

#data
<math><annotation-xml> </annotation-xml>
#errors
Copy link
Contributor

Choose a reason for hiding this comment

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

Should expect some errors for these new tests, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we should. But AFAIK the errors in general are frequently wrong and I felt like giving up when I did this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I found the errors that existed were very helpful when writing a parser, but I understand it's a pain to add and maintain them.

Copy link
Member Author

Choose a reason for hiding this comment

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

@nolanw I just don't have anything off-hand that's up-to-date to generate them from, which is what makes it a real pain. (HTMLReader doesn't have any easy-to-run test binary, does it? That, say, takes input from either a file or stdin and dumps the test expectation format?)

Copy link
Contributor

Choose a reason for hiding this comment

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

I kinda gave up on the errors once things mostly worked ok (surprise!). That's a good idea for a lil binary though, I'll tuck that under my hat and maybe one day the errors will rain down on us all.

(1,6): expected-doctype-but-got-start-tag
(1,40): expected-closing-tag-but-got-eof
#document
| <html>
| <head>
| <body>
| <math math>
| <math annotation-xml>
| " "

#data
<math><annotation-xml>c</annotation-xml>
#errors
(1,6): expected-doctype-but-got-start-tag
(1,40): expected-closing-tag-but-got-eof
#document
| <html>
| <head>
| <body>
| <math math>
| <math annotation-xml>
| "c"

#data
<math><annotation-xml><!--foo-->
#errors
(1,6): expected-doctype-but-got-start-tag
(1,32): expected-closing-tag-but-got-eof
#document
| <html>
| <head>
| <body>
| <math math>
| <math annotation-xml>
| <!-- foo -->

#data
<math><annotation-xml></svg>x
#errors
(1,6): expected-doctype-but-got-start-tag
(1,28): unexpected-end-tag
(1,29): expected-closing-tag-but-got-eof
#document
| <html>
| <head>
| <body>
| <math math>
| <math annotation-xml>
| "x"

#data
<math><annotation-xml><svg>x
#errors
(1,6): expected-doctype-but-got-start-tag
(1,28): expected-closing-tag-but-got-eof
#document
| <html>
| <head>
| <body>
| <math math>
| <math annotation-xml>
| <svg svg>
| "x"