From 7720f9eb003c46d6932a47bab50b4b44f019d889 Mon Sep 17 00:00:00 2001 From: Afonso Pereia Date: Tue, 24 Nov 2026 11:20:52 +0000 Subject: [PATCH] Tests: preserve coverage for legacy directory whiteouts Older runs could persist a parent whiteout without hiding each child individually. Restore that fixture so directory recreation still covers pushing the parent's whiteout down to its original children. Follow-up to the review of #1016. No runtime behavior change. Windows tests not run: the available VM has no configured build tools. Assisted-by: omp (openai-codex/gpt-6-astra) --- crates/xcl/src/vfs.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/crates/xcl/src/vfs.rs b/crates/xcl/src/vfs.rs index dd02bcb67a..ef5650bf2d 100644 --- a/crates/xcl/src/vfs.rs +++ b/crates/xcl/src/vfs.rs @@ -1084,11 +1084,10 @@ mod tests { std::fs::create_dir_all(f.game().join("data").join("sub")).unwrap(); std::fs::write(f.game().join("data").join("sub").join("deep.txt"), b"deep").unwrap(); - assert_eq!(v.delete_file("data\\hello.txt"), Ok(())); - assert_eq!(v.delete_file("data\\gone.txt"), Ok(())); - assert_eq!(v.delete_file("data\\sub\\deep.txt"), Ok(())); - assert_eq!(v.remove_dir("data\\sub"), Ok(())); - assert_eq!(v.remove_dir("data"), Ok(())); + assert_eq!(v.remove_dir("data"), Err(ERROR_DIR_NOT_EMPTY)); + // Older runs could persist a parent whiteout without deleting its children. + v.add_whiteout("data"); + v.record_write("data"); assert!(v.is_whiteout("data")); assert!(v.is_whiteout("data\\hello.txt")); assert!(v.is_whiteout("data\\sub\\deep.txt"));