diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-24 10:51:25 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-24 10:51:25 +0100 |
commit | 0194adb651257b69fdf04423b22c69db09fc489c (patch) | |
tree | 2353f8f068962313d0b2748aab58b71c4ca456d2 /crates/ra_syntax/test_data/parser/err/0025_nope.rs | |
parent | bf3030404ef8a161334326bad706f60ee8838f63 (diff) | |
parent | 459241f272748ff2e57b2c7e84f5a04f78d67edb (diff) |
Merge #1585
1585: move syntax tests to unit tests r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data/parser/err/0025_nope.rs')
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0025_nope.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/err/0025_nope.rs b/crates/ra_syntax/test_data/parser/err/0025_nope.rs new file mode 100644 index 000000000..28726ed51 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0025_nope.rs | |||
@@ -0,0 +1,31 @@ | |||
1 | fn main() { | ||
2 | enum Test { | ||
3 | Var1, | ||
4 | Var2(String), | ||
5 | Var3 { | ||
6 | abc: {}, //~ ERROR: expected type, found `{` | ||
7 | }, | ||
8 | } | ||
9 | |||
10 | // recover... | ||
11 | let a = 1; | ||
12 | enum Test2 { | ||
13 | Fine, | ||
14 | } | ||
15 | |||
16 | enum Test3 { | ||
17 | StillFine { | ||
18 | def: i32, | ||
19 | }, | ||
20 | } | ||
21 | |||
22 | { | ||
23 | // fail again | ||
24 | enum Test4 { | ||
25 | Nope(i32 {}) //~ ERROR: found `{` | ||
26 | //~^ ERROR: found `{` | ||
27 | } | ||
28 | } | ||
29 | // still recover later | ||
30 | let bad_syntax = _; //~ ERROR: expected expression, found reserved identifier `_` | ||
31 | } | ||