From efcfaae34ac7a54e858aad82e6503a7c69d6c550 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 7 Jan 2018 12:32:29 +0300 Subject: Tests for partial parse --- tests/data/parser/0000_empty.rs | 0 tests/data/parser/0000_empty.txt | 1 - tests/data/parser/0001_struct_item.rs | 3 --- tests/data/parser/0001_struct_item.txt | 9 --------- tests/data/parser/0002_struct_item_field.rs | 3 --- tests/data/parser/0002_struct_item_field.txt | 15 --------------- .../parser/err/0000_struct_field_missing_comma.rs | 4 ++++ .../parser/err/0000_struct_field_missing_comma.txt | 20 ++++++++++++++++++++ tests/data/parser/ok/0000_empty.rs | 0 tests/data/parser/ok/0000_empty.txt | 1 + tests/data/parser/ok/0001_struct_item.rs | 3 +++ tests/data/parser/ok/0001_struct_item.txt | 9 +++++++++ tests/data/parser/ok/0002_struct_item_field.rs | 3 +++ tests/data/parser/ok/0002_struct_item_field.txt | 15 +++++++++++++++ 14 files changed, 55 insertions(+), 31 deletions(-) delete mode 100644 tests/data/parser/0000_empty.rs delete mode 100644 tests/data/parser/0000_empty.txt delete mode 100644 tests/data/parser/0001_struct_item.rs delete mode 100644 tests/data/parser/0001_struct_item.txt delete mode 100644 tests/data/parser/0002_struct_item_field.rs delete mode 100644 tests/data/parser/0002_struct_item_field.txt create mode 100644 tests/data/parser/err/0000_struct_field_missing_comma.rs create mode 100644 tests/data/parser/err/0000_struct_field_missing_comma.txt create mode 100644 tests/data/parser/ok/0000_empty.rs create mode 100644 tests/data/parser/ok/0000_empty.txt create mode 100644 tests/data/parser/ok/0001_struct_item.rs create mode 100644 tests/data/parser/ok/0001_struct_item.txt create mode 100644 tests/data/parser/ok/0002_struct_item_field.rs create mode 100644 tests/data/parser/ok/0002_struct_item_field.txt (limited to 'tests/data/parser') diff --git a/tests/data/parser/0000_empty.rs b/tests/data/parser/0000_empty.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/data/parser/0000_empty.txt b/tests/data/parser/0000_empty.txt deleted file mode 100644 index 54be3e7bc..000000000 --- a/tests/data/parser/0000_empty.txt +++ /dev/null @@ -1 +0,0 @@ -FILE@[0; 0) diff --git a/tests/data/parser/0001_struct_item.rs b/tests/data/parser/0001_struct_item.rs deleted file mode 100644 index d3a8c1d23..000000000 --- a/tests/data/parser/0001_struct_item.rs +++ /dev/null @@ -1,3 +0,0 @@ -struct S { - -} \ No newline at end of file diff --git a/tests/data/parser/0001_struct_item.txt b/tests/data/parser/0001_struct_item.txt deleted file mode 100644 index f599e9d2c..000000000 --- a/tests/data/parser/0001_struct_item.txt +++ /dev/null @@ -1,9 +0,0 @@ -FILE@[0; 13) - STRUCT_ITEM@[0; 13) - STRUCT_KW@[0; 6) - WHITESPACE@[6; 7) - IDENT@[7; 8) - WHITESPACE@[8; 9) - L_CURLY@[9; 10) - WHITESPACE@[10; 12) - R_CURLY@[12; 13) diff --git a/tests/data/parser/0002_struct_item_field.rs b/tests/data/parser/0002_struct_item_field.rs deleted file mode 100644 index cc3866d25..000000000 --- a/tests/data/parser/0002_struct_item_field.rs +++ /dev/null @@ -1,3 +0,0 @@ -struct S { - foo: u32 -} \ No newline at end of file diff --git a/tests/data/parser/0002_struct_item_field.txt b/tests/data/parser/0002_struct_item_field.txt deleted file mode 100644 index 87ab3f7a9..000000000 --- a/tests/data/parser/0002_struct_item_field.txt +++ /dev/null @@ -1,15 +0,0 @@ -FILE@[0; 25) - STRUCT_ITEM@[0; 25) - STRUCT_KW@[0; 6) - WHITESPACE@[6; 7) - IDENT@[7; 8) - WHITESPACE@[8; 9) - L_CURLY@[9; 10) - STRUCT_FIELD@[10; 24) - WHITESPACE@[10; 15) - IDENT@[15; 18) - COLON@[18; 19) - WHITESPACE@[19; 20) - IDENT@[20; 23) - WHITESPACE@[23; 24) - R_CURLY@[24; 25) diff --git a/tests/data/parser/err/0000_struct_field_missing_comma.rs b/tests/data/parser/err/0000_struct_field_missing_comma.rs new file mode 100644 index 000000000..fe5030d89 --- /dev/null +++ b/tests/data/parser/err/0000_struct_field_missing_comma.rs @@ -0,0 +1,4 @@ +struct S { + a: u32 + b: u32 +} \ No newline at end of file diff --git a/tests/data/parser/err/0000_struct_field_missing_comma.txt b/tests/data/parser/err/0000_struct_field_missing_comma.txt new file mode 100644 index 000000000..e2e99bb63 --- /dev/null +++ b/tests/data/parser/err/0000_struct_field_missing_comma.txt @@ -0,0 +1,20 @@ +FILE@[0; 34) + STRUCT_ITEM@[0; 34) err: `expected COMMA` + STRUCT_KW@[0; 6) + WHITESPACE@[6; 7) + IDENT@[7; 8) + WHITESPACE@[8; 9) + L_CURLY@[9; 10) + STRUCT_FIELD@[10; 26) + WHITESPACE@[10; 15) + IDENT@[15; 16) + COLON@[16; 17) + WHITESPACE@[17; 18) + IDENT@[18; 21) + WHITESPACE@[21; 26) + STRUCT_FIELD@[26; 33) + IDENT@[26; 27) + COLON@[27; 28) + WHITESPACE@[28; 29) + IDENT@[29; 32) + WHITESPACE@[32; \ No newline at end of file diff --git a/tests/data/parser/ok/0000_empty.rs b/tests/data/parser/ok/0000_empty.rs new file mode 100644 index 000000000..e69de29bb diff --git a/tests/data/parser/ok/0000_empty.txt b/tests/data/parser/ok/0000_empty.txt new file mode 100644 index 000000000..54be3e7bc --- /dev/null +++ b/tests/data/parser/ok/0000_empty.txt @@ -0,0 +1 @@ +FILE@[0; 0) diff --git a/tests/data/parser/ok/0001_struct_item.rs b/tests/data/parser/ok/0001_struct_item.rs new file mode 100644 index 000000000..d3a8c1d23 --- /dev/null +++ b/tests/data/parser/ok/0001_struct_item.rs @@ -0,0 +1,3 @@ +struct S { + +} \ No newline at end of file diff --git a/tests/data/parser/ok/0001_struct_item.txt b/tests/data/parser/ok/0001_struct_item.txt new file mode 100644 index 000000000..f599e9d2c --- /dev/null +++ b/tests/data/parser/ok/0001_struct_item.txt @@ -0,0 +1,9 @@ +FILE@[0; 13) + STRUCT_ITEM@[0; 13) + STRUCT_KW@[0; 6) + WHITESPACE@[6; 7) + IDENT@[7; 8) + WHITESPACE@[8; 9) + L_CURLY@[9; 10) + WHITESPACE@[10; 12) + R_CURLY@[12; 13) diff --git a/tests/data/parser/ok/0002_struct_item_field.rs b/tests/data/parser/ok/0002_struct_item_field.rs new file mode 100644 index 000000000..cc3866d25 --- /dev/null +++ b/tests/data/parser/ok/0002_struct_item_field.rs @@ -0,0 +1,3 @@ +struct S { + foo: u32 +} \ No newline at end of file diff --git a/tests/data/parser/ok/0002_struct_item_field.txt b/tests/data/parser/ok/0002_struct_item_field.txt new file mode 100644 index 000000000..87ab3f7a9 --- /dev/null +++ b/tests/data/parser/ok/0002_struct_item_field.txt @@ -0,0 +1,15 @@ +FILE@[0; 25) + STRUCT_ITEM@[0; 25) + STRUCT_KW@[0; 6) + WHITESPACE@[6; 7) + IDENT@[7; 8) + WHITESPACE@[8; 9) + L_CURLY@[9; 10) + STRUCT_FIELD@[10; 24) + WHITESPACE@[10; 15) + IDENT@[15; 18) + COLON@[18; 19) + WHITESPACE@[19; 20) + IDENT@[20; 23) + WHITESPACE@[23; 24) + R_CURLY@[24; 25) -- cgit v1.2.3