mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
update readme with testing information
This commit is contained in:
parent
58887629da
commit
03e9b237a5
1 changed files with 18 additions and 0 deletions
|
@ -25,3 +25,21 @@ and run!
|
||||||
```
|
```
|
||||||
luau-ast Examples/SmokeTest.lua | ./PrettyPrinter
|
luau-ast Examples/SmokeTest.lua | ./PrettyPrinter
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Testing
|
||||||
|
|
||||||
|
We have a series of snapshot tests in the `Tests/` directory. You interact with the tests using the `tests` Python script in the `prototyping` directory. To simply run the tests, run:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
tests --luau-cli ../build/luau-ast --build
|
||||||
|
```
|
||||||
|
|
||||||
|
This will build the test targets and run them. Run `tests --help` for information about all the command-line options.
|
||||||
|
|
||||||
|
### Adding a new test
|
||||||
|
|
||||||
|
To add a new test, add it to `Tests/{SUITE_NAME}/{CASE_NAME}`. You'll need an `in.lua` file and an `out.txt` file. The `in.lua` file is the input Luau source code, while the `out.txt` file is the expected output after running `luau-ast in.lua | test_executable`.
|
||||||
|
|
||||||
|
### Updating a test
|
||||||
|
|
||||||
|
If you make a change to the prototype that results in an expected change in behavior, you might want to update the test cases automatically. To do this, run `tests` with the `--accept-new-output` (`-a` for short) flag. Rather than diffing the output, this will overwrite the `out.txt` files for each test case with the actual result. Commit the resulting changes with your PR.
|
||||||
|
|
Loading…
Add table
Reference in a new issue