diff options
Diffstat (limited to 'crates/ra_syntax/tests/test.rs')
-rw-r--r-- | crates/ra_syntax/tests/test.rs | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs index 91799f8b5..4b711f271 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, fuzz}; | 11 | use ra_syntax::{SourceFile, fuzz}; |
12 | 12 | ||
13 | #[test] | 13 | #[test] |
14 | fn lexer_tests() { | 14 | fn lexer_tests() { |
@@ -21,26 +21,21 @@ fn lexer_tests() { | |||
21 | #[test] | 21 | #[test] |
22 | fn parser_tests() { | 22 | fn parser_tests() { |
23 | dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| { | 23 | dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| { |
24 | let file = SourceFile::parse(text); | 24 | let parse = SourceFile::parse2(text); |
25 | let errors = file.errors(); | 25 | let errors = parse.errors.as_slice(); |
26 | assert_eq!( | 26 | assert_eq!( |
27 | &*errors, | 27 | errors, |
28 | &[] as &[ra_syntax::SyntaxError], | 28 | &[] as &[ra_syntax::SyntaxError], |
29 | "There should be no errors in the file {:?}", | 29 | "There should be no errors in the file {:?}", |
30 | path.display() | 30 | path.display(), |
31 | ); | 31 | ); |
32 | file.syntax().debug_dump() | 32 | parse.debug_dump() |
33 | }); | 33 | }); |
34 | dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], |text, path| { | 34 | dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], |text, path| { |
35 | let file = SourceFile::parse(text); | 35 | let parse = SourceFile::parse2(text); |
36 | let errors = file.errors(); | 36 | let errors = parse.errors.as_slice(); |
37 | assert_ne!( | 37 | assert!(!errors.is_empty(), "There should be errors in the file {:?}", path.display()); |
38 | &*errors, | 38 | parse.debug_dump() |
39 | &[] as &[ra_syntax::SyntaxError], | ||
40 | "There should be errors in the file {:?}", | ||
41 | path.display() | ||
42 | ); | ||
43 | file.syntax().debug_dump() | ||
44 | }); | 39 | }); |
45 | } | 40 | } |
46 | 41 | ||