Highlight will automatically carry out syntax tests when the input filename starts with syntax_test_.
The test system was inspired by Sublime Text's syntax tests and it's very simple to use. It exploits columns markers and state indicators in comment lines within the source file to indicate the expected highlight state for elements in the previous non-comment line of code:
#include "myheader"//< ppc ^^^^^^^^^^ pps
In the above example, the notation in the comment line informs Highlight to check that that the tokens in the previous line are highlighted correctly:
#include as preprocessor string (pps)
"myheader" as preprocessor string (pps).
Highlight will report test failures via console messages.
Highlight Testcases Manual
For more details, refer to the Highlight Testcases Manual that ships with Highlight:
The ultimate goal of the project is to gather under the same roof syntax tests for all the languages that ship with Highlight. Syntax developers can fork the project and use branches to test their changes to current langDefs or their new language definitions, before submitting them to the Highlight project. A test suite provides a solid starting point to ensure that changes to a syntax definition don't have unexpected side effects.