mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
Improve reparse fuzz test
This commit is contained in:
parent
0acb61a911
commit
c622000413
1 changed files with 13 additions and 1 deletions
|
@ -46,7 +46,19 @@ impl CheckReparse {
|
|||
assert_eq!(&new_file.syntax().text().to_string(), &self.edited_text);
|
||||
let full_reparse = SourceFile::parse(&self.edited_text);
|
||||
for (a, b) in new_file.syntax().descendants().zip(full_reparse.syntax().descendants()) {
|
||||
assert_eq!(a.kind(), b.kind(), "different syntax tree produced by a full reparse");
|
||||
if (a.kind(), a.range()) != (b.kind(), b.range()) {
|
||||
eprint!("original:\n{}", file.syntax().debug_dump());
|
||||
eprint!("reparsed:\n{}", new_file.syntax().debug_dump());
|
||||
eprint!("full reparse:\n{}", full_reparse.syntax().debug_dump());
|
||||
assert_eq!(
|
||||
format!("{:?}", a),
|
||||
format!("{:?}", b),
|
||||
"different syntax tree produced by the full reparse"
|
||||
);
|
||||
}
|
||||
}
|
||||
// FIXME
|
||||
// assert_eq!(new_file.errors(), full_reparse.errors());
|
||||
assert_eq!(new_file.errors().is_empty(), full_reparse.errors().is_empty());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue