From 515c3bc59bfc227cbbb82f80b53c5c125be4fc30 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sun, 23 Dec 2018 12:15:46 +0100 Subject: Cleanup --- crates/ra_syntax/tests/test.rs | 56 +++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) (limited to 'crates/ra_syntax/tests') 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 @@ extern crate ra_syntax; -#[macro_use] extern crate test_utils; extern crate walkdir; use std::{ fmt::Write, - fs, - path::{Path, PathBuf, Component}, + path::{PathBuf, Component}, }; use test_utils::{project_dir, dir_tests, read_text, collect_tests}; @@ -25,28 +23,36 @@ fn lexer_tests() { #[test] fn parser_tests() { - dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| { - let file = SourceFileNode::parse(text); - let errors = file.errors(); - assert_eq!( - &*errors, - &[] as &[ra_syntax::SyntaxError], - "There should be no errors in the file {:?}", - path.display() - ); - dump_tree(file.syntax()) - }); - dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], |text, path| { - let file = SourceFileNode::parse(text); - let errors = file.errors(); - assert_ne!( - &*errors, - &[] as &[ra_syntax::SyntaxError], - "There should be errors in the file {:?}", - path.display() - ); - dump_tree(file.syntax()) - }); + dir_tests( + &test_data_dir(), + &["parser/inline/ok", "parser/ok"], + |text, path| { + let file = SourceFileNode::parse(text); + let errors = file.errors(); + assert_eq!( + &*errors, + &[] as &[ra_syntax::SyntaxError], + "There should be no errors in the file {:?}", + path.display() + ); + dump_tree(file.syntax()) + }, + ); + dir_tests( + &test_data_dir(), + &["parser/err", "parser/inline/err"], + |text, path| { + let file = SourceFileNode::parse(text); + let errors = file.errors(); + assert_ne!( + &*errors, + &[] as &[ra_syntax::SyntaxError], + "There should be errors in the file {:?}", + path.display() + ); + dump_tree(file.syntax()) + }, + ); } #[test] -- cgit v1.2.3