From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- third_party/rust/nix/test/test_net.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 third_party/rust/nix/test/test_net.rs (limited to 'third_party/rust/nix/test/test_net.rs') diff --git a/third_party/rust/nix/test/test_net.rs b/third_party/rust/nix/test/test_net.rs new file mode 100644 index 0000000000..c44655a4c9 --- /dev/null +++ b/third_party/rust/nix/test/test_net.rs @@ -0,0 +1,19 @@ +use nix::net::if_::*; + +#[cfg(any(target_os = "android", target_os = "linux"))] +const LOOPBACK: &[u8] = b"lo"; + +#[cfg(not(any( + target_os = "android", + target_os = "linux", + target_os = "haiku" +)))] +const LOOPBACK: &[u8] = b"lo0"; + +#[cfg(target_os = "haiku")] +const LOOPBACK: &[u8] = b"loop"; + +#[test] +fn test_if_nametoindex() { + if_nametoindex(LOOPBACK).expect("assertion failed"); +} -- cgit v1.2.3