diff options
Diffstat (limited to 'crates/ra_syntax/tests')
-rw-r--r-- | crates/ra_syntax/tests/data/reparse/fuzz-failures/0000.rs | 6 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/reparse/fuzz-failures/0001.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/reparse/fuzz-failures/0002.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs | bin | 0 -> 8 bytes | |||
-rw-r--r-- | crates/ra_syntax/tests/data/reparse/fuzz-failures/0004.rs | 4 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/reparse/fuzz-failures/0005.rs | 7 | ||||
-rw-r--r-- | crates/ra_syntax/tests/test.rs | 13 |
7 files changed, 36 insertions, 2 deletions
diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0000.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0000.rs new file mode 100644 index 000000000..388eb74ed --- /dev/null +++ b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0000.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | 0 | ||
2 | 1 | ||
3 | |||
4 | |||
5 | |||
6 | 0 \ No newline at end of file | ||
diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0001.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0001.rs new file mode 100644 index 000000000..d2d42c6f9 --- /dev/null +++ b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0001.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | 0 | ||
2 | 1 | ||
3 | |||
4 | bb" \ No newline at end of file | ||
diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0002.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0002.rs new file mode 100644 index 000000000..3fbee1548 --- /dev/null +++ b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0002.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | 1 | ||
2 | 1 | ||
3 | |||
4 | ""! \ No newline at end of file | ||
diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs new file mode 100644 index 000000000..d2757cd08 --- /dev/null +++ b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0003.rs | |||
Binary files differ | |||
diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0004.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0004.rs new file mode 100644 index 000000000..481617a70 --- /dev/null +++ b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0004.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | 0 | ||
2 | 0 | ||
3 | } | ||
4 | {; \ No newline at end of file | ||
diff --git a/crates/ra_syntax/tests/data/reparse/fuzz-failures/0005.rs b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0005.rs new file mode 100644 index 000000000..074d761c7 --- /dev/null +++ b/crates/ra_syntax/tests/data/reparse/fuzz-failures/0005.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | 05 | ||
2 | 1 | ||
3 | |||
4 | |||
5 | |||
6 | b' | ||
7 | \ No newline at end of file | ||
diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs index 458740c13..537b01368 100644 --- a/crates/ra_syntax/tests/test.rs +++ b/crates/ra_syntax/tests/test.rs | |||
@@ -8,7 +8,7 @@ use std::{ | |||
8 | }; | 8 | }; |
9 | 9 | ||
10 | use test_utils::{project_dir, dir_tests, read_text, collect_tests}; | 10 | use test_utils::{project_dir, dir_tests, read_text, collect_tests}; |
11 | use ra_syntax::{SourceFile, AstNode, check_fuzz_invariants}; | 11 | use ra_syntax::{SourceFile, AstNode, fuzz}; |
12 | 12 | ||
13 | #[test] | 13 | #[test] |
14 | fn lexer_tests() { | 14 | fn lexer_tests() { |
@@ -47,7 +47,16 @@ fn parser_tests() { | |||
47 | #[test] | 47 | #[test] |
48 | fn parser_fuzz_tests() { | 48 | fn parser_fuzz_tests() { |
49 | for (_, text) in collect_tests(&test_data_dir(), &["parser/fuzz-failures"]) { | 49 | for (_, text) in collect_tests(&test_data_dir(), &["parser/fuzz-failures"]) { |
50 | check_fuzz_invariants(&text) | 50 | fuzz::check_parser(&text) |
51 | } | ||
52 | } | ||
53 | |||
54 | #[test] | ||
55 | fn reparse_fuzz_tests() { | ||
56 | for (_, text) in collect_tests(&test_data_dir(), &["reparse/fuzz-failures"]) { | ||
57 | let check = fuzz::CheckReparse::from_data(text.as_bytes()).unwrap(); | ||
58 | println!("{:?}", check); | ||
59 | check.run(); | ||
51 | } | 60 | } |
52 | } | 61 | } |
53 | 62 | ||