mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
WIP: switch to fully decomposed tokens internally
This commit is contained in:
parent
e2ebb467bd
commit
40170885e7
12 changed files with 422 additions and 279 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue