Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically generate expected JSON for .test files #2401

Closed
RunDevelopment opened this issue May 23, 2020 · 0 comments · Fixed by #2515
Closed

Automatically generate expected JSON for .test files #2401

RunDevelopment opened this issue May 23, 2020 · 0 comments · Fixed by #2515

Comments

@RunDevelopment
Copy link
Member

Motivation
Writing test files, while important, has always been a pain. I made #1801 because I got tired of having to format the token stream by hand.
I'm even lazier now and want the test runner to insert the token stream for me.

Jokes aside, the basic idea is that you only need to add some code and a description and the test runner will insert the JSON itself. This makes it a lot easier to create test files because you don't even have to copy-paste the token stream anymore, you just accept the highlighting as correct.
Updating the test files after small changes (e.g. adding a few new keywords) will also be easier.

I think that this may lead to test files with errors since the developer no longer has to look at the token stream (though, it is questionable that devs look at the token stream when copy-pasting it).

Description
Add a CLI option --insert to npm run test:languages that will automatically insert the actual token stream in .test files where the actual and the accept token stream aren't equal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant