Skip to content

Commit 86742a7

Browse files
committed
Add testing for submodule parsing after grammar update
1 parent 3cecc3e commit 86742a7

File tree

3 files changed

+39
-2
lines changed

3 files changed

+39
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@
507507
"watch": "npm run compile -- --watch",
508508
"pretest": "tsc -p ./",
509509
"test": "node ./out/tests/runTest.js",
510-
"test:tlaplus-grammar": "vscode-tmgrammar-test ./tests/suite/languages/tlaplus-grammar-test.tla -g ./languages/tlaplus-grammar.json -g ./languages/pluscal-grammar.json"
510+
"test:tlaplus-grammar": "vscode-tmgrammar-test ./tests/suite/languages/tlaplus-grammar-test.tla ./tests/suite/languages/tlaplus-grammar-test-submodule.tla -g ./languages/tlaplus-grammar.json -g ./languages/pluscal-grammar.json"
511511
},
512512
"devDependencies": {
513513
"@types/glob": "^8.1.0",

tests/suite/languages/GrammarTests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Grammar tests are defined under [tests/suite/languages](.)
88

99
A grammar test is a test file that includes annotation of the expected assigned scopes. One example is the [tlaplus-grammar-test.tla](tlaplus-grammar-test.tla).
1010

11-
For more information on how to write a test see [vscode-tmgrammar-test](thttps://github.com/PanAeon/vscode-tmgrammar-test).
11+
For more information on how to write a test see [vscode-tmgrammar-test](https://github.com/PanAeon/vscode-tmgrammar-test).
1212

1313
## Run the tests
1414
To run from the command line:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SYNTAX TEST "source.tlaplus" "tlaplus language grammar testcase"
2+
3+
---- MODULE SubmoduleTest ----
4+
// <---- comment.line
5+
// ^^^^^^ keyword.other
6+
// ^^^^^^^^^^^^^ entity.name.class
7+
---- MODULE InnerModule1 ----
8+
// <---- comment.line
9+
// ^^^^^^ keyword.other
10+
// ^^^^^^^^^^^^ entity.name.class
11+
12+
Op1 == FALSE
13+
//<-- support.type.primitive
14+
// ^^^^^ support.constant.tlaplus
15+
16+
====
17+
// <---- comment.line
18+
19+
---- MODULE InnerModule2 ----
20+
// <---- comment.line
21+
// ^^^^^^ keyword.other
22+
// ^^^^^^^^^^^^ entity.name.class
23+
24+
Op2 == FALSE
25+
//<-- support.type.primitive
26+
// ^^^^^ support.constant.tlaplus
27+
28+
29+
====
30+
// <---- comment.line
31+
32+
Op == FALSE
33+
//<-- support.type.primitive
34+
// ^^^^^ support.constant.tlaplus
35+
36+
====
37+
// <---- comment.line

0 commit comments

Comments
 (0)