Skip to content

Commit 71de9db

Browse files
author
Jethro Beekman
committed
Add test
1 parent 70c267f commit 71de9db

File tree

1 file changed

+14
-0
lines changed
  • src/libstd/sys/windows

1 file changed

+14
-0
lines changed

src/libstd/sys/windows/os.rs

+14
Original file line numberDiff line numberDiff line change
@@ -317,3 +317,17 @@ pub fn home_dir() -> Option<PathBuf> {
317317
pub fn exit(code: i32) -> ! {
318318
unsafe { c::ExitProcess(code as c::UINT) }
319319
}
320+
321+
#[cfg(test)]
322+
mod tests {
323+
use io::Error;
324+
use sys::c;
325+
326+
// tests `error_string` above
327+
#[test]
328+
fn ntstatus_error() {
329+
const STATUS_UNSUCCESSFUL: u32 = 0xc000_0001;
330+
assert!(!Error::from_raw_os_error((STATUS_UNSUCCESSFUL | c::FACILITY_NT_BIT) as _)
331+
.to_string().contains("FormatMessageW() returned error"));
332+
}
333+
}

0 commit comments

Comments
 (0)