Add tests for invalid UTF-8 encoding in the text format#474
Conversation
|
I'm torn. The more tests the better, but it is a large number of files. OTOH, once #471 lands, we probably want similar tests checking the UTF-8 encoding of the input itself (i.e., invalid UTF-8 occurring directly, not escaped, in either strings or comments). Perhaps a solution is to introduce a subdirectory for everything Unicode related? |
|
Couldn't the need for the .fail.wast files be eliminated by adding an |
|
@AndrewScheidecker, ha, interesting idea. Let me think about that. |
|
PR #475 landed, so these tests can now be written in just one file. |
|
@sunfishcode, any chance you can adapt this PR? |
|
I still do intend to do this, though it's not a high priority right now. |
9998f29 to
92c1c91
Compare
|
Pushed a change to refactor these. Hope you don't mind! :-) |
rossberg
left a comment
There was a problem hiding this comment.
Cool, thanks. LGTM (without looking at all the tests individually).
|
When you merge, can you make sure to update the title/description? |
|
@binji That looks like all that needs to be done here then. Thanks! |
remove duplicated token definition in parser
This adds a ".fail.wast" test file for each of the 179 invalid UTF-8 byte sequences created for the other UTF-8 tests. This provides some test coverage for validation on the text parsing side (because it matters for some consumers), however it's an awkwardly large number of files, and I don't know if it's worth the hassle. In any case, here's the PR in case anyone's interested.