aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/tests
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2018-12-23 11:15:46 +0000
committerFlorian Diebold <[email protected]>2018-12-23 12:48:04 +0000
commit515c3bc59bfc227cbbb82f80b53c5c125be4fc30 (patch)
treec4087228b2443a562c60906306f5a1385fb6968d /crates/ra_syntax/tests
parent7348f7883fa2bd571fff036c82e98c102d05c362 (diff)
Cleanup
Diffstat (limited to 'crates/ra_syntax/tests')
-rw-r--r--crates/ra_syntax/tests/test.rs56
1 files changed, 31 insertions, 25 deletions
diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs
index 9d94a1a23..2235dc401 100644
--- a/crates/ra_syntax/tests/test.rs
+++ b/crates/ra_syntax/tests/test.rs
@@ -1,12 +1,10 @@
1extern crate ra_syntax; 1extern crate ra_syntax;
2#[macro_use]
3extern crate test_utils; 2extern crate test_utils;
4extern crate walkdir; 3extern crate walkdir;
5 4
6use std::{ 5use std::{
7 fmt::Write, 6 fmt::Write,
8 fs, 7 path::{PathBuf, Component},
9 path::{Path, PathBuf, Component},
10}; 8};
11 9
12use test_utils::{project_dir, dir_tests, read_text, collect_tests}; 10use test_utils::{project_dir, dir_tests, read_text, collect_tests};
@@ -25,28 +23,36 @@ fn lexer_tests() {
25 23
26#[test] 24#[test]
27fn parser_tests() { 25fn parser_tests() {
28 dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| { 26 dir_tests(
29 let file = SourceFileNode::parse(text); 27 &test_data_dir(),
30 let errors = file.errors(); 28 &["parser/inline/ok", "parser/ok"],
31 assert_eq!( 29 |text, path| {
32 &*errors, 30 let file = SourceFileNode::parse(text);
33 &[] as &[ra_syntax::SyntaxError], 31 let errors = file.errors();
34 "There should be no errors in the file {:?}", 32 assert_eq!(
35 path.display() 33 &*errors,
36 ); 34 &[] as &[ra_syntax::SyntaxError],
37 dump_tree(file.syntax()) 35 "There should be no errors in the file {:?}",
38 }); 36 path.display()
39 dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], |text, path| { 37 );
40 let file = SourceFileNode::parse(text); 38 dump_tree(file.syntax())
41 let errors = file.errors(); 39 },
42 assert_ne!( 40 );
43 &*errors, 41 dir_tests(
44 &[] as &[ra_syntax::SyntaxError], 42 &test_data_dir(),
45 "There should be errors in the file {:?}", 43 &["parser/err", "parser/inline/err"],
46 path.display() 44 |text, path| {
47 ); 45 let file = SourceFileNode::parse(text);
48 dump_tree(file.syntax()) 46 let errors = file.errors();
49 }); 47 assert_ne!(
48 &*errors,
49 &[] as &[ra_syntax::SyntaxError],
50 "There should be errors in the file {:?}",
51 path.display()
52 );
53 dump_tree(file.syntax())
54 },
55 );
50} 56}
51 57
52#[test] 58#[test]