Open catamorphism opened 3 months ago
Doing much better than #844 would probably require some automation.
Note that completeness also requires exhaustively generating tests that should produce syntax errors, which I have less of an idea how to do systematically (other than through fuzzing.)
I wrote a simple random test generator, hard-wired for the MF2 grammar, and was able to find some bugs in the ICU4C parser with the generated test cases.
This is from https://github.com/unicode-org/message-format-wg/wiki/Things-That-Need-Doing . I didn't see an existing issue for it.
Full test coverage is probably impossible given the size of the grammar. But there are a couple possibilities:
As far as option 2, with a few modifications, I was able to run the grammar through abnfgen and Eusthasius. The problem is that both of them generate tests that resemble line noise, suggesting that fuzzing might be preferable.
Option 1 has the advantage that it's easy to write readable, minimal test cases. Of course the disadvantage is that it's tedious.
Any suggestions are welcome.