summaryrefslogtreecommitdiff
path: root/src/syntax/incremental.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax/incremental.rs')
-rw-r--r--src/syntax/incremental.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/syntax/incremental.rs b/src/syntax/incremental.rs
index d5dea9d0..606daa2e 100644
--- a/src/syntax/incremental.rs
+++ b/src/syntax/incremental.rs
@@ -404,9 +404,23 @@ fn next_at_start(kind: &SyntaxKind, prev: bool) -> bool {
#[cfg(test)]
#[rustfmt::skip]
mod tests {
+ use std::fmt::Debug;
+
use super::*;
use super::super::{parse, Source};
- use super::super::tests::check;
+
+ #[track_caller]
+ fn check<T>(text: &str, found: T, expected: T)
+ where
+ T: Debug + PartialEq,
+ {
+ if found != expected {
+ println!("source: {text:?}");
+ println!("expected: {expected:#?}");
+ println!("found: {found:#?}");
+ panic!("test failed");
+ }
+ }
#[track_caller]
fn test(prev: &str, range: Range<usize>, with: &str, goal: Range<usize>) {