This commit is contained in:
ge
2026-05-01 23:03:05 +03:00
parent 04a644869e
commit ed674e41e1
10 changed files with 430 additions and 412 deletions
+29
View File
@@ -0,0 +1,29 @@
import netio
fn test_network_interfaces() {
ifs := netio.network_interfaces()!
// dump(ifs)
assert ifs.len > 0
}
fn test_name_to_index() {
ifs := netio.network_interfaces()!
iface := ifs[0]
dump(iface)
assert netio.name_to_index(iface.name)! == iface.index
}
fn test_index_to_name() {
ifs := netio.network_interfaces()!
iface := ifs[0]
dump(iface)
assert netio.index_to_name(iface.index)! == iface.name
}
fn test_find_network_interface() {
ifs := netio.network_interfaces()!
iface := ifs[0]
dump(iface)
assert netio.find_network_interface(iface.name)!.name == iface.name
assert netio.find_network_interface(iface.index.str())!.index == iface.index
}