On 18. Apr 2007, at 19:08, Daryl Spitzer wrote:
Oops. I got caught submitting a change without testing it. I don't seem capable of never repeating that mistake--that's where automated tests come in handy.
Is there any facility for creating automated tests for language grammar rules? [...]
Currently not, but in 2.0 my plan is to have “mate” (or more likely a dedicated shell command) expose a bit of TM functionality to the shell, this includes parsing a file and outputting the XML (as one can currently get as input from a TM command).
This will make it fairly simple to write scripts (or a framework) for testing grammars, something we definitely do want to have :)
One little nicety is that this can also perform benchmarks on grammars, reporting which rules the parser spends the most time with (making it easier to find problematic rules).