From 40170885e799ebdefb24ed00865cd1c7800af491 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 9 Sep 2019 14:52:31 +0300 Subject: WIP: switch to fully decomposed tokens internally --- crates/ra_syntax/src/tests.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'crates/ra_syntax/src') diff --git a/crates/ra_syntax/src/tests.rs b/crates/ra_syntax/src/tests.rs index fa5d2d5d8..458920607 100644 --- a/crates/ra_syntax/src/tests.rs +++ b/crates/ra_syntax/src/tests.rs @@ -15,6 +15,18 @@ fn lexer_tests() { }) } +#[test] +fn parse_smoke_test() { + let code = r##" +fn main() { + println!("Hello, world!") +} + "##; + + let parse = SourceFile::parse(code); + assert!(parse.ok().is_ok()); +} + #[test] fn parser_tests() { dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| { @@ -75,7 +87,9 @@ fn self_hosting_parsing() { { count += 1; let text = read_text(entry.path()); - SourceFile::parse(&text).ok().expect("There should be no errors in the file"); + if let Err(errors) = SourceFile::parse(&text).ok() { + panic!("Parsing errors:\n{:?}\n{}\n", errors, entry.path().display()); + } } assert!( count > 30, -- cgit v1.2.3