aboutsummaryrefslogtreecommitdiff
path: root/docs/TESTS.md
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2018-02-03 19:44:37 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2018-02-03 19:44:37 +0000
commit75b59bf519b8dcf1a89327d871dab2c98af61ed9 (patch)
tree6322bf271a4fd5e838098a0f523739fc9a0c9416 /docs/TESTS.md
parent3c70ae2e26f654ce536f00fde8c159e4ebe6901a (diff)
parentb072e68ad5bf1687aebd2ff1c7bf327d38a6a2f2 (diff)
Merge #39
39: Tools r=matklad a=matklad closes #34 bors r+
Diffstat (limited to 'docs/TESTS.md')
-rw-r--r--docs/TESTS.md16
1 files changed, 15 insertions, 1 deletions
diff --git a/docs/TESTS.md b/docs/TESTS.md
index 8005ec9da..db06dbebc 100644
--- a/docs/TESTS.md
+++ b/docs/TESTS.md
@@ -19,12 +19,26 @@ files to have the same name except for the leading number. In general,
19test suite should be append-only: old tests should not be modified, 19test suite should be append-only: old tests should not be modified,
20new tests should be created instead. 20new tests should be created instead.
21 21
22
23Note that only `ok` tests are normative: `err` tests test error 22Note that only `ok` tests are normative: `err` tests test error
24recovery and it is totally ok for a parser to not implement any error 23recovery and it is totally ok for a parser to not implement any error
25recovery at all. However, for libsyntax2.0 we do care about error 24recovery at all. However, for libsyntax2.0 we do care about error
26recovery, and we do care about precise and useful error messages. 25recovery, and we do care about precise and useful error messages.
27 26
27There are also so-called "inline tests". They appear as the comments
28with a `test` header in the source code, like this:
29
30```rust
31// test fn_basic
32// fn foo() {}
33fn fn_item(p: &mut Parser) {
34 // ...
35}
36```
37
38You can run `cargo collect-tests` command to collect all inline tests
39into `tests/data/inline` directory. The main advantage of inline tests
40is that they help to illustrate what the relevant code is doing.
41
28 42
29Contribution opportunity: design and implement testing infrastructure 43Contribution opportunity: design and implement testing infrastructure
30for validators. 44for validators.