Conversation
|
Nice! |
Global options can be added to a file by writing on the first line: Parser options: `ENABLE_ABC | ENABLE_XYZ` Further options can be written in the lang string: ```````````````````````````````` example ENABLE_YUV
This should make it easier to find a failing test.
a120576 to
4fcaa4e
Compare
There was a problem hiding this comment.
I pushed a fix to the heading_attrs.txt problem here: notriddle@26306b4
You can add it to your branch by running these commands:
$ git fetch https://github.com/notriddle/pulldown-cmark spec-test-options
$ git merge FETCH_HEADThere was a problem hiding this comment.
.example?
Have these tests ever actually been run?! 🤦
There was a problem hiding this comment.
Damn. When changing the test collector, I was kind of worried that it's easy to accidentally write a non-test, since it needs the exact number of backticks and example.
Would it make sense to warn about lines that have a large number of backticks but don't match, or something like that?
There was a problem hiding this comment.
Makes sense. Accepting anything with more than 8 backticks is another alternative.
We could also warn about things with a hamming distance lower than 4 for instance or matching a regular expression similar to the accepted values to avoid things like .example, but probably not so useful and prone to false positives.
I feel that the current system where we define ad-hoc test types
example_deflistsetc. and pass those around as booleans is starting reach its limits. Instead, we could usebitflags::parser::from_strto define theOptionsdirectly.For convenience, I added two ways to set options. The effective options are the union of both.
Global options can be added to a file by writing on the first line:
Further options can be written in the lang string:
I also made it so that the test generator
struct Speckeeps track of the current line in the file and names the test likeblockquotes_tags_test_0005_l44, so it's easier to locate.