Files
rust/library/std/tests/win_delete_self.rs
2025-01-26 06:17:12 +00:00

9 lines
227 B
Rust

#![cfg(windows)]
/// Attempting to delete a running binary should return an error on Windows.
#[test]
fn win_delete_self() {
let path = std::env::current_exe().unwrap();
assert!(std::fs::remove_file(path).is_err());
}