aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-09-10 14:01:44 +0100
committerGitHub <[email protected]>2019-09-10 14:01:44 +0100
commit9d3c78e2eee6635772c99d7351b621cefb08bac5 (patch)
tree14e74b81c7195bcd5b308e799c3fd447e76274ca /crates/ra_syntax/src
parente2ebb467bdf3ebb7d29260adb95c56594c6db282 (diff)
parented726081d1df2fb6a1c21101996dcae203f79021 (diff)
Merge #1801
1801: WIP: switch to fully decomposed tokens internally r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/tests.rs16
1 files changed, 15 insertions, 1 deletions
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
@@ -16,6 +16,18 @@ fn lexer_tests() {
16} 16}
17 17
18#[test] 18#[test]
19fn parse_smoke_test() {
20 let code = r##"
21fn main() {
22 println!("Hello, world!")
23}
24 "##;
25
26 let parse = SourceFile::parse(code);
27 assert!(parse.ok().is_ok());
28}
29
30#[test]
19fn parser_tests() { 31fn parser_tests() {
20 dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| { 32 dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| {
21 let parse = SourceFile::parse(text); 33 let parse = SourceFile::parse(text);
@@ -75,7 +87,9 @@ fn self_hosting_parsing() {
75 { 87 {
76 count += 1; 88 count += 1;
77 let text = read_text(entry.path()); 89 let text = read_text(entry.path());
78 SourceFile::parse(&text).ok().expect("There should be no errors in the file"); 90 if let Err(errors) = SourceFile::parse(&text).ok() {
91 panic!("Parsing errors:\n{:?}\n{}\n", errors, entry.path().display());
92 }
79 } 93 }
80 assert!( 94 assert!(
81 count > 30, 95 count > 30,