diff --git a/crates/engine/src/tests.rs b/crates/engine/src/tests.rs
--- a/crates/engine/src/tests.rs
+++ b/crates/engine/src/tests.rs
@@ -10852,6 +10852,7 @@ fn export_png_refuses_a_path_that_is_not_png() {
 #[test]
 fn ime_body_epoch_marks_body_replacements_not_edits() {
     let mut s = s();
+    let document_id = s.document_id();
     run(&mut s, "text.insert", json!({"text": "one"}));
     let first = s.ime_body_epoch();
     run(&mut s, "text.insert", json!({"text": " two"}));
@@ -10860,7 +10861,7 @@ fn ime_body_epoch_marks_body_replacements_not_edits() {
     run(&mut s, "document.setText", json!({"text": "same text"}));
     let replaced = s.ime_body_epoch();
     assert!(replaced > first, "setText replaces the body under the same document id");
-    assert_eq!(s.document_id(), 1, "the document id itself is unchanged");
+    assert_eq!(s.document_id(), document_id, "the document id itself is unchanged");
 
     // The same text again still replaces the body: a composition must not survive on content
     // equality.
diff --git a/crates/mcp/tests/automation_roots.rs b/crates/mcp/tests/automation_roots.rs
--- a/crates/mcp/tests/automation_roots.rs
+++ b/crates/mcp/tests/automation_roots.rs
@@ -210,6 +210,7 @@ fn links_out_of_a_root_are_refused() {
 }
 
 /// The names in `dir`, sorted.
+#[cfg(unix)]
 fn names(dir: &Path) -> Vec<String> {
     let mut names: Vec<String> = std::fs::read_dir(dir).unwrap().map(|e| e.unwrap().file_name().to_string_lossy().into_owned()).collect();
     names.sort();
diff --git a/crates/proof/src/hunspell.rs b/crates/proof/src/hunspell.rs
--- a/crates/proof/src/hunspell.rs
+++ b/crates/proof/src/hunspell.rs
@@ -332,7 +332,10 @@ mod tests {
         assert!(load(&aff, &big).unwrap_err().contains("too large"));
         // A directory, and on Unix an endless device, are not dictionary files. (No clock: a
         // reader that read `/dev/zero` would never return, so the error itself is the proof.)
-        assert!(load(&aff, &dir).unwrap_err().contains("not a regular file"));
+        let directory_error = load(&aff, &dir).unwrap_err();
+        // Windows denies opening a directory before its file metadata can be checked.
+        let rejected_directory = directory_error.contains("not a regular file") || (cfg!(windows) && directory_error.contains("(os error 5)"));
+        assert!(rejected_directory, "{directory_error}");
         #[cfg(unix)]
         assert!(load(&aff, Path::new("/dev/zero")).unwrap_err().contains("not a regular file"));
         // Turkish reads through the same reader.
