You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dev/README.md
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -303,6 +303,17 @@ Rather than talking in definitions and references, it talks in Strings and textu
303
303
In 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.
304
304
The results are 100% Rust specific though.
305
305
306
+
## Parser Tests
307
+
308
+
Test for parser (`ra_parser`) live in `ra_syntax` crate (see `test_data` direcotory).
309
+
There 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
+
314
+
The 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.
315
+
If 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
317
# Logging
307
318
308
319
Logging is done by both rust-analyzer and VS Code, so it might be tricky to
0 commit comments