aboutsummaryrefslogtreecommitdiff
path: root/docs/dev
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-10 13:12:32 +0100
committerGitHub <[email protected]>2020-06-10 13:12:32 +0100
commit96309ba4a1bbbffd1c03f50a21bb68526550b925 (patch)
tree14e8945d06fa2121856331c146386c6d1ceaf337 /docs/dev
parentf632727b2ab985a9c5ceca781d033a08ee3822ea (diff)
parent1538206609dbb88f10ff2525523096bab0c65740 (diff)
Merge #4835
4835: Explain inline tests r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'docs/dev')
-rw-r--r--docs/dev/README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md
index 0330939b6..cf93135ee 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -303,6 +303,17 @@ Rather than talking in definitions and references, it talks in Strings and textu
303In general, API is centered around UI concerns -- the result of the call is what the user sees in the editor, and not what the compiler sees underneath. 303In general, API is centered around UI concerns -- the result of the call is what the user sees in the editor, and not what the compiler sees underneath.
304The results are 100% Rust specific though. 304The results are 100% Rust specific though.
305 305
306## Parser Tests
307
308Test for parser (`ra_parser`) live in `ra_syntax` crate (see `test_data` direcotory).
309There are two kinds of tests:
310
311* Manually written test cases in `parser/ok` and `parser/error`
312* "Inline" tests in `parser/inline` (these are generated) from comments in `ra_parser` crate.
313
314The purpose of inline tests is not to achieve full coverage by test cases, but to explain to the reader of the code what each particular `if` and `match` is responsible for.
315If you are tempted to add a large inline test, it might be a good idea to leave only the simplest example in place, and move the test to a manual `parser/ok` test.
316
306# Logging 317# Logging
307 318
308Logging is done by both rust-analyzer and VS Code, so it might be tricky to 319Logging is done by both rust-analyzer and VS Code, so it might be tricky to