From 18f87b9497b01940356bf3d6d5253ccb70cb573c Mon Sep 17 00:00:00 2001 From: Micha Reiser Date: Tue, 30 Jul 2024 20:09:55 +0200 Subject: [PATCH] Flaky file watching tests, add debug assertions (#12587) --- crates/red_knot/src/watch/watcher.rs | 2 +- crates/red_knot/tests/file_watching.rs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/red_knot/src/watch/watcher.rs b/crates/red_knot/src/watch/watcher.rs index 6e9f712302..58a88f39a0 100644 --- a/crates/red_knot/src/watch/watcher.rs +++ b/crates/red_knot/src/watch/watcher.rs @@ -240,7 +240,7 @@ impl Debouncer { } ModifyKind::Data(_) => ChangeEvent::Changed { - kind: ChangedKind::FileMetadata, + kind: ChangedKind::FileContent, path, }, diff --git a/crates/red_knot/tests/file_watching.rs b/crates/red_knot/tests/file_watching.rs index 1396c56c2b..6d0cac87cf 100644 --- a/crates/red_knot/tests/file_watching.rs +++ b/crates/red_knot/tests/file_watching.rs @@ -265,6 +265,8 @@ fn changed_file() -> anyhow::Result<()> { let changes = case.stop_watch(); + assert!(!changes.is_empty()); + case.db_mut().apply_changes(changes); assert_eq!(source_text(case.db(), foo).as_str(), "print('Version 2')");