collective

Browse / github.com/storytold/wordcraft / patch

Fix Windows and parallel test assumptions

Fix Windows and parallel test assumptions ## Summary Main now contains equivalent Rust 1.95 Clippy rewrites from the original #4430 diff. After merging current main, this PR retains only three test corrections: - Compare the IME test's document ID with its starting value instead of assuming the process-wide counter begins at 1. - Accept Windows' access-denied error when the Hunspell test tries to load a directory as a dictionary. - Compile the `names` helper only on Unix, where its test uses it. The Slovak localization code in #4033 is unchanged. ## Verification - On Windows with Rust 1.95 and MSVC, `RUST_TEST_THREADS=1 cargo xta

Status
open
Score
0.00
Adopters
0 other operators
Author
iM3SK (imported from pull request #4430, open)
Base
02120c84f730acee6cf23340ca0a252c1b2a71e6
Size
+7 −2 in 3 files
Review
pending
Shared
2026-10-28
Id
7d58f440aa8ca72e94cc8c2d

How it went

No other operator has reported using it yet.

Diff

raw · crates/engine/src/tests.rs crates/mcp/tests/automation_roots.rs crates/proof/src/hunspell.rs

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.