Is it possible to create automated tests for a *.tmLanguage
or *.sublime-syntax
file? What is the best practices for doing that?
Asked
Active
Viewed 377 times
0

user619271
- 4,766
- 5
- 30
- 35
-
3http://www.sublimetext.com/docs/3/syntax.html - search for `Testing`. Then, when you are in a `sublime-syntax` file or a `syntax_test` file, you can use the ST build system to run the tests. – Keith Hall Apr 19 '16 at 06:30
-
How can you do that? I've been trying to do it, but can seem to make it work. the syntax documentation states that running "build" should do the trick, however it does not seem to do anything for me. – Rodrigo Oct 31 '19 at 13:47
-
1There is [`vscode-tmgrammar-test`](https://github.com/PanAeon/vscode-tmgrammar-test) to test `tmLanguage` for VS Code; I assume that the `tmLanguage` files are compatible (they actually came from TextMate), so it might also help you (or future visitors from Google). – Franklin Yu Apr 04 '23 at 04:57
1 Answers
1
I'd probably use SublimeLinter with plugins, since you get instant feedback while working on a file. xmllint works for *.tmLanguage
, and pyyaml for *.sublime-syntax
.
Personally, I'm using a gruntfile to test my packages, but that's not as integrated as using SublimeLinter. However, it can be used with Travis CI and the likes.

idleberg
- 12,634
- 7
- 43
- 70