From b9cbbfa4052a080d658ce32dedac03c4621ce5ed Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 28 Jan 2018 18:59:16 +0300 Subject: Test for error recovery for broken parameters --- .../err/0009_broken_struct_type_parameter.rs | 5 +++ .../err/0009_broken_struct_type_parameter.txt | 42 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tests/data/parser/err/0009_broken_struct_type_parameter.rs create mode 100644 tests/data/parser/err/0009_broken_struct_type_parameter.txt (limited to 'tests/data/parser') diff --git a/tests/data/parser/err/0009_broken_struct_type_parameter.rs b/tests/data/parser/err/0009_broken_struct_type_parameter.rs new file mode 100644 index 000000000..0dd30d0bd --- /dev/null +++ b/tests/data/parser/err/0009_broken_struct_type_parameter.rs @@ -0,0 +1,5 @@ +struct S<90 + 2> { + f: u32 +} + +struct T; diff --git a/tests/data/parser/err/0009_broken_struct_type_parameter.txt b/tests/data/parser/err/0009_broken_struct_type_parameter.txt new file mode 100644 index 000000000..c6b1adb0c --- /dev/null +++ b/tests/data/parser/err/0009_broken_struct_type_parameter.txt @@ -0,0 +1,42 @@ +FILE@[0; 43) + STRUCT_ITEM@[0; 12) + STRUCT_KW@[0; 6) + WHITESPACE@[6; 7) + IDENT@[7; 8) + TYPE_PARAM_LIST@[8; 12) + L_ANGLE@[8; 9) + ERROR@[9; 12) + err: `expected type parameter` + INT_NUMBER@[9; 11) + WHITESPACE@[11; 12) + err: `expected COMMA` + err: `expected R_ANGLE` + err: `expected `;`, `{`, or `(`` + ERROR@[12; 14) + err: `expected item` + PLUS@[12; 13) + WHITESPACE@[13; 14) + ERROR@[14; 15) + err: `expected item` + INT_NUMBER@[14; 15) + ERROR@[15; 17) + err: `expected item` + R_ANGLE@[15; 16) + WHITESPACE@[16; 17) + ERROR@[17; 33) + err: `expected item` + L_CURLY@[17; 18) + WHITESPACE@[18; 23) + IDENT@[23; 24) + COLON@[24; 25) + WHITESPACE@[25; 26) + IDENT@[26; 29) + WHITESPACE@[29; 30) + R_CURLY@[30; 31) + WHITESPACE@[31; 33) + STRUCT_ITEM@[33; 43) + STRUCT_KW@[33; 39) + WHITESPACE@[39; 40) + IDENT@[40; 41) + SEMI@[41; 42) + WHITESPACE@[42; 43) -- cgit v1.2.3