home ~ projects ~ socials

Testing Neopolitan's Parser

In-Flight Testing

I'm pulling the code to parse Neopolitan files out of Neopoligen to make a stand-alone parser. I'm doing some refactoring to improve things based on what I've learned over the past couple years when I started the project.

As part of that, I'm improving the code that tests the parer itself. This is what that looks like:

A screen shot of a Neovim editor showing a lines of parser test cases going all the way from the top to the bottom. Each line starts with a 'case' statement followed by the test values to parse. The all start with the word 'alfa'. Each one has slightly different characters behind it. The rest of the line shows what parts should match and what parts shouldn't

There's a bunch of tests above and blew that too. And, all that is just to test how aspect of the parser1

It can get tedious. But, once you get into a flow it goes pretty quick. Knowing everything is well tested also makes it an easy sell.

-a

-- end of line --

Footnotes

Specifically, it makes sure "flags" in shorthand spans work properly. A flag being something like:

hidden

in

<<span|some text|hidden>>

All those tests for just that one word position.