about summary refs log tree commit diff
path: root/library/std/tests/win_delete_self.rs
blob: ce505de69a22d691048d68d4fdcf8f6e86d6d904 (plain)
1
2
3
4
5
6
7
8
9
#![cfg(windows)]

/// Attempting to delete a running binary should return an error on Windows.
#[test]
#[cfg_attr(miri, ignore)] // `remove_file` does not work in Miri on Windows
fn win_delete_self() {
    let path = std::env::current_exe().unwrap();
    assert!(std::fs::remove_file(path).is_err());
}