diff --git a/test-suite.html b/test-suite.html index 79fed5e6e7..0dbd535016 100644 --- a/test-suite.html +++ b/test-suite.html @@ -50,7 +50,7 @@
All tests are sorted into directories in the tests/languages
directory. Each directory name encodes, which language you are currently testing.
All language names must match the names from the definition in components.js
.
All language names must match the names from the definition in components.json
.
Just put your test file into the directory of the language you want to test.
@@ -92,8 +92,8 @@npm run test:languages -- --insert
command. You can read more about this and related commands here. --insert
or --update
flag is present when running the test command.
+ The test runner will automatically insert this if not present. Carefully check that the inserted token stream is what you expected. --update
flag to overwrite it.
tests/languages/{language}/{test-case}.test
.npm run test:languages -- --insert
.npm run test:languages
.This works by making the test runner insert the actual token stream of you test code as the expected token stream. Carefully check that the inserted token stream is actually what you expect or else the test is meaningless!
-More details about the command can be found here.
-When creating and changing languages, their test files have to be updated to properly test the language. The rather tedious task of updating test files can be automated using the following commands:
+When creating and changing languages, their test files have to be updated to properly test the language. The rather tedious task of updating test files can be automated using the following command:
-npm run test:languages -- --insert
-
- This will insert the current actual token stream into all test files without an expected token stream. Test files that have an expected token stream are not affected.
- -This command is intended to be used when you want to create new test files while not updating existing ones.
-npm run test:languages -- --update
+ npm run test:languages -- --update
- Updates (overwrites) the expected token stream of all failing test files and all test files that do not have an expected token stream. The language tests are guaranteed to pass after running this command.
-Updates (overwrites) the expected token stream of all failing test files. The language tests are guaranteed to pass after running this command.
-Keep in mind: Both commands make it easy to create/update test files but this doesn't mean that the tests will be correct. Always carefully check the inserted/updated token streams!
+Keep in mind: This command makes it easy to create/update test files but this doesn't mean that the tests will be correct. Always carefully check the inserted/updated token streams!
Note: The pretty-printed simplified token stream is indented using 4 spaces. You have to convert these to tabs after you copy-pasted the JSON. (Most editors today have an option that handles the conversion for you.)
+The simplified token stream does not contain the aliases of a token.
For further information: reading the tests of the test runner (tests/testrunner-tests.js
) will help you understand the transformation.