diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_syntax/src/fuzz.rs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/fuzz.rs b/crates/ra_syntax/src/fuzz.rs index efb080ac2..c7084bc6d 100644 --- a/crates/ra_syntax/src/fuzz.rs +++ b/crates/ra_syntax/src/fuzz.rs | |||
@@ -46,7 +46,19 @@ impl CheckReparse { | |||
46 | assert_eq!(&new_file.syntax().text().to_string(), &self.edited_text); | 46 | assert_eq!(&new_file.syntax().text().to_string(), &self.edited_text); |
47 | let full_reparse = SourceFile::parse(&self.edited_text); | 47 | let full_reparse = SourceFile::parse(&self.edited_text); |
48 | for (a, b) in new_file.syntax().descendants().zip(full_reparse.syntax().descendants()) { | 48 | for (a, b) in new_file.syntax().descendants().zip(full_reparse.syntax().descendants()) { |
49 | assert_eq!(a.kind(), b.kind(), "different syntax tree produced by a full reparse"); | 49 | if (a.kind(), a.range()) != (b.kind(), b.range()) { |
50 | eprint!("original:\n{}", file.syntax().debug_dump()); | ||
51 | eprint!("reparsed:\n{}", new_file.syntax().debug_dump()); | ||
52 | eprint!("full reparse:\n{}", full_reparse.syntax().debug_dump()); | ||
53 | assert_eq!( | ||
54 | format!("{:?}", a), | ||
55 | format!("{:?}", b), | ||
56 | "different syntax tree produced by the full reparse" | ||
57 | ); | ||
58 | } | ||
50 | } | 59 | } |
60 | // FIXME | ||
61 | // assert_eq!(new_file.errors(), full_reparse.errors()); | ||
62 | assert_eq!(new_file.errors().is_empty(), full_reparse.errors().is_empty()); | ||
51 | } | 63 | } |
52 | } | 64 | } |