Files
rust/library/std/tests/win_delete_self.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

9 lines
227 B
Rust
Raw Normal View History

#![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());
}