1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-12 02:49:35 +00:00

Implement TestWork functionality for preserving working directories on failure

Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-27 17:27:10 +00:00
parent 6cb1109c05
commit fe5da3cebe
7 changed files with 282 additions and 5 deletions

View file

@ -301,6 +301,15 @@ impl TestEnvironment {
result
}
/// Preserve the work directory by preventing TempDir cleanup
/// Returns the path to the preserved directory
pub fn preserve_work_dir(self) -> std::path::PathBuf {
let work_dir = self.work_dir.clone();
// Leak the TempDir to prevent cleanup
std::mem::forget(self._temp_dir);
work_dir
}
}
#[cfg(test)]