Syntax Highighting - Tests 2018-08-19

Tags:
By Max Woerner Chase

In this post:


I've made three test files from the writeups I've done so far. One test file is focused around comments, and various extensions to them. One test file is focused specifically on encoding declarations. And the last test file is basically some sanity checks around line continuations.

Writing these test files was much less fiddly than the documentation made it look like it might be. Turns out there's all sorts of auto-completion for syntax tests. The bit that I'm least sure about is, it kind of looks like the tests are sensitive to the order that the scopes apply in? I wasn't expecting that, but, okay, tests on a single line are order-sensitive.

Having the tests is nice, because it makes it super simple to tweak the syntax file and be sure I didn't break everything. I made some tweaks to the comments handling, but I'll probably hold off on further changes for now.

Looking forward, I want to say, okay, every day, I either write up a section or convert a writeup into tests. Just kind of methodically grind through the syntax documentation. Then, when I have enough coverage, I can get to work on redoing the name handling, without worrying about hosing the rest of it.


Next time, I look over all of this.