nix/test/test_net.rs
2016-01-27 17:18:58 -05:00

13 lines
254 B
Rust

use nix::net::if_::*;
#[cfg(target_os = "linux")]
const LOOPBACK: &'static [u8] = b"lo";
#[cfg(not(target_os = "linux"))]
const LOOPBACK: &'static [u8] = b"lo0";
#[test]
fn test_if_nametoindex() {
assert!(if_nametoindex(&LOOPBACK[..]).is_ok());
}