summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/tests/io/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/rustix/tests/io/error.rs')
-rw-r--r--vendor/rustix/tests/io/error.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/vendor/rustix/tests/io/error.rs b/vendor/rustix/tests/io/error.rs
new file mode 100644
index 000000000..128d3b59a
--- /dev/null
+++ b/vendor/rustix/tests/io/error.rs
@@ -0,0 +1,14 @@
+#[test]
+fn test_error() {
+ assert_eq!(
+ rustix::io::Errno::INVAL,
+ rustix::io::Errno::from_raw_os_error(rustix::io::Errno::INVAL.raw_os_error())
+ );
+ #[cfg(not(windows))]
+ assert_eq!(rustix::io::Errno::INVAL.raw_os_error(), libc::EINVAL);
+ #[cfg(windows)]
+ assert_eq!(
+ rustix::io::Errno::INVAL.raw_os_error(),
+ windows_sys::Win32::Networking::WinSock::WSAEINVAL
+ );
+}