diff options
author | Aleksey Kladov <[email protected]> | 2018-02-03 19:34:35 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-02-03 19:34:35 +0000 |
commit | 9b3d806b0dbfcf76ff707aa86daba83454227720 (patch) | |
tree | bfefe85725b772a44a9abf3823128d08344a6b66 /tests | |
parent | 9435ea4b8e990521ee7a6206b6106bb3ce392746 (diff) |
Add infra for inline tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/parser/inline/0001_const_unsafe_fn.rs | 1 | ||||
-rw-r--r-- | tests/data/parser/inline/0001_const_unsafe_fn.txt | 15 | ||||
-rw-r--r-- | tests/data/parser/inline/0002_const_fn.rs | 1 | ||||
-rw-r--r-- | tests/data/parser/inline/0002_const_fn.txt | 13 | ||||
-rw-r--r-- | tests/data/parser/ok/0024_const_fn.rs | 5 | ||||
-rw-r--r-- | tests/data/parser/ok/0024_const_fn.txt | 29 | ||||
-rw-r--r-- | tests/data/parser/ok/0024_const_item.rs (renamed from tests/data/parser/ok/0025_const_item.rs) | 0 | ||||
-rw-r--r-- | tests/data/parser/ok/0024_const_item.txt (renamed from tests/data/parser/ok/0025_const_item.txt) | 0 | ||||
-rw-r--r-- | tests/parser.rs | 2 |
9 files changed, 31 insertions, 35 deletions
diff --git a/tests/data/parser/inline/0001_const_unsafe_fn.rs b/tests/data/parser/inline/0001_const_unsafe_fn.rs new file mode 100644 index 000000000..31a1e435f --- /dev/null +++ b/tests/data/parser/inline/0001_const_unsafe_fn.rs | |||
@@ -0,0 +1 @@ | |||
const unsafe fn foo() {} | |||
diff --git a/tests/data/parser/inline/0001_const_unsafe_fn.txt b/tests/data/parser/inline/0001_const_unsafe_fn.txt new file mode 100644 index 000000000..1f0865cb0 --- /dev/null +++ b/tests/data/parser/inline/0001_const_unsafe_fn.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | FILE@[0; 25) | ||
2 | FN_ITEM@[0; 25) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | UNSAFE_KW@[6; 12) | ||
6 | WHITESPACE@[12; 13) | ||
7 | FN_KW@[13; 15) | ||
8 | WHITESPACE@[15; 16) | ||
9 | IDENT@[16; 19) "foo" | ||
10 | L_PAREN@[19; 20) | ||
11 | R_PAREN@[20; 21) | ||
12 | WHITESPACE@[21; 22) | ||
13 | L_CURLY@[22; 23) | ||
14 | R_CURLY@[23; 24) | ||
15 | WHITESPACE@[24; 25) | ||
diff --git a/tests/data/parser/inline/0002_const_fn.rs b/tests/data/parser/inline/0002_const_fn.rs new file mode 100644 index 000000000..8c84d9cd7 --- /dev/null +++ b/tests/data/parser/inline/0002_const_fn.rs | |||
@@ -0,0 +1 @@ | |||
const fn foo() {} | |||
diff --git a/tests/data/parser/inline/0002_const_fn.txt b/tests/data/parser/inline/0002_const_fn.txt new file mode 100644 index 000000000..2d360d78b --- /dev/null +++ b/tests/data/parser/inline/0002_const_fn.txt | |||
@@ -0,0 +1,13 @@ | |||
1 | FILE@[0; 18) | ||
2 | FN_ITEM@[0; 18) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | FN_KW@[6; 8) | ||
6 | WHITESPACE@[8; 9) | ||
7 | IDENT@[9; 12) "foo" | ||
8 | L_PAREN@[12; 13) | ||
9 | R_PAREN@[13; 14) | ||
10 | WHITESPACE@[14; 15) | ||
11 | L_CURLY@[15; 16) | ||
12 | R_CURLY@[16; 17) | ||
13 | WHITESPACE@[17; 18) | ||
diff --git a/tests/data/parser/ok/0024_const_fn.rs b/tests/data/parser/ok/0024_const_fn.rs deleted file mode 100644 index eba9322a1..000000000 --- a/tests/data/parser/ok/0024_const_fn.rs +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | const fn foo() { | ||
2 | } | ||
3 | |||
4 | const unsafe fn foo() { | ||
5 | } | ||
diff --git a/tests/data/parser/ok/0024_const_fn.txt b/tests/data/parser/ok/0024_const_fn.txt deleted file mode 100644 index 0fd485997..000000000 --- a/tests/data/parser/ok/0024_const_fn.txt +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | FILE@[0; 46) | ||
2 | FN_ITEM@[0; 20) | ||
3 | CONST_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | FN_KW@[6; 8) | ||
6 | WHITESPACE@[8; 9) | ||
7 | IDENT@[9; 12) "foo" | ||
8 | L_PAREN@[12; 13) | ||
9 | R_PAREN@[13; 14) | ||
10 | WHITESPACE@[14; 15) | ||
11 | L_CURLY@[15; 16) | ||
12 | WHITESPACE@[16; 17) | ||
13 | R_CURLY@[17; 18) | ||
14 | WHITESPACE@[18; 20) | ||
15 | FN_ITEM@[20; 46) | ||
16 | CONST_KW@[20; 25) | ||
17 | WHITESPACE@[25; 26) | ||
18 | UNSAFE_KW@[26; 32) | ||
19 | WHITESPACE@[32; 33) | ||
20 | FN_KW@[33; 35) | ||
21 | WHITESPACE@[35; 36) | ||
22 | IDENT@[36; 39) "foo" | ||
23 | L_PAREN@[39; 40) | ||
24 | R_PAREN@[40; 41) | ||
25 | WHITESPACE@[41; 42) | ||
26 | L_CURLY@[42; 43) | ||
27 | WHITESPACE@[43; 44) | ||
28 | R_CURLY@[44; 45) | ||
29 | WHITESPACE@[45; 46) | ||
diff --git a/tests/data/parser/ok/0025_const_item.rs b/tests/data/parser/ok/0024_const_item.rs index 7446859b5..7446859b5 100644 --- a/tests/data/parser/ok/0025_const_item.rs +++ b/tests/data/parser/ok/0024_const_item.rs | |||
diff --git a/tests/data/parser/ok/0025_const_item.txt b/tests/data/parser/ok/0024_const_item.txt index 588e001f5..588e001f5 100644 --- a/tests/data/parser/ok/0025_const_item.txt +++ b/tests/data/parser/ok/0024_const_item.txt | |||
diff --git a/tests/parser.rs b/tests/parser.rs index f681c066f..68a6434be 100644 --- a/tests/parser.rs +++ b/tests/parser.rs | |||
@@ -7,7 +7,7 @@ use testutils::dir_tests; | |||
7 | 7 | ||
8 | #[test] | 8 | #[test] |
9 | fn parser_tests() { | 9 | fn parser_tests() { |
10 | dir_tests(&["parser/ok", "parser/err"], |text| { | 10 | dir_tests(&["parser/inline", "parser/ok", "parser/err"], |text| { |
11 | let tokens = tokenize(text); | 11 | let tokens = tokenize(text); |
12 | let file = parse(text.to_string(), &tokens); | 12 | let file = parse(text.to_string(), &tokens); |
13 | dump_tree(&file) | 13 | dump_tree(&file) |