Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.03 KB

GrammarTests.md

File metadata and controls

27 lines (20 loc) · 1.03 KB

Grammar tests

Grammar tests test the grammars defined under the languages directory.

Current test coverage is:

  • tlaplus-grammar.json

Grammar tests are defined under tests/suite/languages

A grammar test is a test file that includes annotation of the expected assigned scopes. One example is the tlaplus-grammar-test.tla.

For more information on how to write a test see vscode-tmgrammar-test.

Run the tests

To run from the command line:

npm run test:tlaplus-grammar

To run from VS Code:

  1. Open the project directory in VS Code.
  2. Switch to the Debug and Run panel.
  3. Select the "Run TLA Plus Grammar Tests" config.

Adding tests

After adding a new test file for a grammar test:

  • Update the npm command to include that test file in package.json.
  • Update launch.json to include an option to run the new test.