2017-03-30 17:59:13 +00:00
|
|
|
# JavaScript tests with expected output
|
|
|
|
|
2018-10-03 09:28:25 +00:00
|
|
|
Tests in `test/message` pass if the output matches the expected output.
|
|
|
|
Message tests are particularly useful when checking for exact error messages.
|
2017-03-30 17:59:13 +00:00
|
|
|
|
|
|
|
Tests and their expected output must have the same filename, with the `.js` and
|
|
|
|
`.out` extension.
|
|
|
|
|
|
|
|
```
|
|
|
|
foo.js
|
|
|
|
foo.out
|
|
|
|
```
|
|
|
|
|
2018-10-03 09:28:25 +00:00
|
|
|
You can use a regex in the expected output instead of the exact
|
|
|
|
path:
|
|
|
|
|
|
|
|
```
|
2017-03-30 17:59:13 +00:00
|
|
|
*%(basename)s:7: SyntaxError: Detected cycle while resolving name 'a'
|
|
|
|
```
|
2018-10-03 09:28:25 +00:00
|
|
|
|
2017-03-30 17:59:13 +00:00
|
|
|
Empty lines are ignored in the comparison, but whitespaces are not.
|
|
|
|
|
|
|
|
Exact details of the test runner are in [testcfg.py](testcfg.py).
|