Files
herolib/lib/osal/core/net_test.v
Mahmoud-Emad 49bf9dbf80 test: Update ping test assertions
- Use boolean `true` for successful ping
- Use boolean `false` for ping timeout
- Use boolean `false` for unknown host
2025-09-03 10:24:19 +03:00

22 lines
393 B
V

module core
fn test_ipaddr_pub_get() {
ipaddr := ipaddr_pub_get()!
assert ipaddr != ''
}
fn test_ping() {
x := ping(address: '127.0.0.1', retry: 1)!
assert x == true
}
fn test_ping_timeout() ! {
x := ping(address: '192.168.145.154', retry: 5, nr_ok: 1)!
assert x == false
}
fn test_ping_unknownhost() ! {
x := ping(address: '12.902.219.1', retry: 1, nr_ok: 1)!
assert x == false
}