From ba885b7dd627abb630c495779769ec03971f9e7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 20 Mar 2026 18:52:03 +0100 Subject: [PATCH] Ensure test file is cleaned up in cwd_is_writable test case --- tests/integration.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/integration.rs b/tests/integration.rs index 774fab3..8c5c202 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -9,8 +9,18 @@ fn sandbox(extra_args: &[&str]) -> Command { cmd } +struct CleanupFile(&'static str); + +impl Drop for CleanupFile { + fn drop(&mut self) { + let _ = fs::remove_file(self.0); + } +} + #[test] fn cwd_is_writable() { + let _cleanup = CleanupFile("./sandbox_canary"); + let output = sandbox(&[]) .args(["--", "bash", "-c", "touch ./sandbox_canary && echo ok"]) .output()