2025-01-26 06:15:58 +00:00
|
|
|
#![cfg(windows)]
|
|
|
|
|
|
|
|
/// Attempting to delete a running binary should return an error on Windows.
|
|
|
|
#[test]
|
2025-02-10 08:08:32 +01:00
|
|
|
#[cfg_attr(miri, ignore)] // `remove_file` does not work in Miri on Windows
|
2025-01-26 06:15:58 +00:00
|
|
|
fn win_delete_self() {
|
|
|
|
let path = std::env::current_exe().unwrap();
|
|
|
|
assert!(std::fs::remove_file(path).is_err());
|
|
|
|
}
|