From 5398b9eeba14a3e73eb9a8b7e0d2e703e052585d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 16 Jan 2020 18:39:29 +0100 Subject: Minimize test --- crates/ra_parser/src/grammar/expressions/atom.rs | 16 ++----- .../ok/0135_first_array_member_attributes.rs | 5 -- .../ok/0135_first_array_member_attributes.txt | 53 ---------------------- .../ok/0136_subsequent_array_member_attributes.rs | 5 -- .../ok/0136_subsequent_array_member_attributes.txt | 53 ---------------------- .../test_data/parser/inline/ok/0150_array_attrs.rs | 1 + .../parser/inline/ok/0150_array_attrs.txt | 47 +++++++++++++++++++ 7 files changed, 51 insertions(+), 129 deletions(-) delete mode 100644 crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs delete mode 100644 crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt delete mode 100644 crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs delete mode 100644 crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt create mode 100644 crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs create mode 100644 crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt (limited to 'crates') diff --git a/crates/ra_parser/src/grammar/expressions/atom.rs b/crates/ra_parser/src/grammar/expressions/atom.rs index 5c413317e..a98a2a3ef 100644 --- a/crates/ra_parser/src/grammar/expressions/atom.rs +++ b/crates/ra_parser/src/grammar/expressions/atom.rs @@ -188,19 +188,9 @@ fn array_expr(p: &mut Parser) -> CompletedMarker { p.bump(T!['[']); while !p.at(EOF) && !p.at(T![']']) { n_exprs += 1; - // test first_array_member_attributes - // pub const A: &[i64] = &[ - // #[cfg(test)] - // 1, - // 2, - // ]; - - // test subsequent_array_member_attributes - // pub const A: &[i64] = &[ - // 1, - // #[cfg(test)] - // 2, - // ]; + + // test array_attrs + // const A: &[i64] = &[1, #[cfg(test)] 2]; let m = p.start(); let has_attrs = p.at(T![#]); attributes::outer_attributes(p); diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs deleted file mode 100644 index f59e13771..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub const A: &[i64] = &[ - #[cfg(test)] - 1, - 2, -]; diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt deleted file mode 100644 index 2e3a13005..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0135_first_array_member_attributes.txt +++ /dev/null @@ -1,53 +0,0 @@ -SOURCE_FILE@[0; 56) - CONST_DEF@[0; 55) - VISIBILITY@[0; 3) - PUB_KW@[0; 3) "pub" - WHITESPACE@[3; 4) " " - CONST_KW@[4; 9) "const" - WHITESPACE@[9; 10) " " - NAME@[10; 11) - IDENT@[10; 11) "A" - COLON@[11; 12) ":" - WHITESPACE@[12; 13) " " - REFERENCE_TYPE@[13; 19) - AMP@[13; 14) "&" - SLICE_TYPE@[14; 19) - L_BRACK@[14; 15) "[" - PATH_TYPE@[15; 18) - PATH@[15; 18) - PATH_SEGMENT@[15; 18) - NAME_REF@[15; 18) - IDENT@[15; 18) "i64" - R_BRACK@[18; 19) "]" - WHITESPACE@[19; 20) " " - EQ@[20; 21) "=" - WHITESPACE@[21; 22) " " - REF_EXPR@[22; 54) - AMP@[22; 23) "&" - ARRAY_EXPR@[23; 54) - L_BRACK@[23; 24) "[" - WHITESPACE@[24; 28) "\n " - LITERAL@[28; 45) - ATTR@[28; 40) - POUND@[28; 29) "#" - L_BRACK@[29; 30) "[" - PATH@[30; 33) - PATH_SEGMENT@[30; 33) - NAME_REF@[30; 33) - IDENT@[30; 33) "cfg" - TOKEN_TREE@[33; 39) - L_PAREN@[33; 34) "(" - IDENT@[34; 38) "test" - R_PAREN@[38; 39) ")" - R_BRACK@[39; 40) "]" - WHITESPACE@[40; 44) "\n " - INT_NUMBER@[44; 45) "1" - COMMA@[45; 46) "," - WHITESPACE@[46; 50) "\n " - LITERAL@[50; 51) - INT_NUMBER@[50; 51) "2" - COMMA@[51; 52) "," - WHITESPACE@[52; 53) "\n" - R_BRACK@[53; 54) "]" - SEMI@[54; 55) ";" - WHITESPACE@[55; 56) "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs deleted file mode 100644 index 1324acb3f..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.rs +++ /dev/null @@ -1,5 +0,0 @@ -pub const A: &[i64] = &[ - 1, - #[cfg(test)] - 2, -]; diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt b/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt deleted file mode 100644 index 1bb8a0afc..000000000 --- a/crates/ra_syntax/test_data/parser/inline/ok/0136_subsequent_array_member_attributes.txt +++ /dev/null @@ -1,53 +0,0 @@ -SOURCE_FILE@[0; 56) - CONST_DEF@[0; 55) - VISIBILITY@[0; 3) - PUB_KW@[0; 3) "pub" - WHITESPACE@[3; 4) " " - CONST_KW@[4; 9) "const" - WHITESPACE@[9; 10) " " - NAME@[10; 11) - IDENT@[10; 11) "A" - COLON@[11; 12) ":" - WHITESPACE@[12; 13) " " - REFERENCE_TYPE@[13; 19) - AMP@[13; 14) "&" - SLICE_TYPE@[14; 19) - L_BRACK@[14; 15) "[" - PATH_TYPE@[15; 18) - PATH@[15; 18) - PATH_SEGMENT@[15; 18) - NAME_REF@[15; 18) - IDENT@[15; 18) "i64" - R_BRACK@[18; 19) "]" - WHITESPACE@[19; 20) " " - EQ@[20; 21) "=" - WHITESPACE@[21; 22) " " - REF_EXPR@[22; 54) - AMP@[22; 23) "&" - ARRAY_EXPR@[23; 54) - L_BRACK@[23; 24) "[" - WHITESPACE@[24; 28) "\n " - LITERAL@[28; 29) - INT_NUMBER@[28; 29) "1" - COMMA@[29; 30) "," - WHITESPACE@[30; 34) "\n " - LITERAL@[34; 51) - ATTR@[34; 46) - POUND@[34; 35) "#" - L_BRACK@[35; 36) "[" - PATH@[36; 39) - PATH_SEGMENT@[36; 39) - NAME_REF@[36; 39) - IDENT@[36; 39) "cfg" - TOKEN_TREE@[39; 45) - L_PAREN@[39; 40) "(" - IDENT@[40; 44) "test" - R_PAREN@[44; 45) ")" - R_BRACK@[45; 46) "]" - WHITESPACE@[46; 50) "\n " - INT_NUMBER@[50; 51) "2" - COMMA@[51; 52) "," - WHITESPACE@[52; 53) "\n" - R_BRACK@[53; 54) "]" - SEMI@[54; 55) ";" - WHITESPACE@[55; 56) "\n" diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs new file mode 100644 index 000000000..2ac310924 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.rs @@ -0,0 +1 @@ +const A: &[i64] = &[1, #[cfg(test)] 2]; diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt new file mode 100644 index 000000000..78e296f88 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0150_array_attrs.txt @@ -0,0 +1,47 @@ +SOURCE_FILE@[0; 40) + CONST_DEF@[0; 39) + CONST_KW@[0; 5) "const" + WHITESPACE@[5; 6) " " + NAME@[6; 7) + IDENT@[6; 7) "A" + COLON@[7; 8) ":" + WHITESPACE@[8; 9) " " + REFERENCE_TYPE@[9; 15) + AMP@[9; 10) "&" + SLICE_TYPE@[10; 15) + L_BRACK@[10; 11) "[" + PATH_TYPE@[11; 14) + PATH@[11; 14) + PATH_SEGMENT@[11; 14) + NAME_REF@[11; 14) + IDENT@[11; 14) "i64" + R_BRACK@[14; 15) "]" + WHITESPACE@[15; 16) " " + EQ@[16; 17) "=" + WHITESPACE@[17; 18) " " + REF_EXPR@[18; 38) + AMP@[18; 19) "&" + ARRAY_EXPR@[19; 38) + L_BRACK@[19; 20) "[" + LITERAL@[20; 21) + INT_NUMBER@[20; 21) "1" + COMMA@[21; 22) "," + WHITESPACE@[22; 23) " " + LITERAL@[23; 37) + ATTR@[23; 35) + POUND@[23; 24) "#" + L_BRACK@[24; 25) "[" + PATH@[25; 28) + PATH_SEGMENT@[25; 28) + NAME_REF@[25; 28) + IDENT@[25; 28) "cfg" + TOKEN_TREE@[28; 34) + L_PAREN@[28; 29) "(" + IDENT@[29; 33) "test" + R_PAREN@[33; 34) ")" + R_BRACK@[34; 35) "]" + WHITESPACE@[35; 36) " " + INT_NUMBER@[36; 37) "2" + R_BRACK@[37; 38) "]" + SEMI@[38; 39) ";" + WHITESPACE@[39; 40) "\n" -- cgit v1.2.3