1e33bfa4bc
Co-authored-by: Cursor <cursoragent@cursor.com>
20 lines
347 B
Go
20 lines
347 B
Go
package hostmeta
|
|
|
|
import "testing"
|
|
|
|
func TestHostnameNonEmpty(t *testing.T) {
|
|
h, err := Hostname()
|
|
if err != nil || h == "" {
|
|
t.Fatalf("hostname: %q err=%v", h, err)
|
|
}
|
|
}
|
|
|
|
func TestIPsSkipsLoopback(t *testing.T) {
|
|
ips := IPs()
|
|
for _, ip := range ips {
|
|
if ip == "127.0.0.1" || ip == "::1" {
|
|
t.Fatalf("loopback in ips: %v", ips)
|
|
}
|
|
}
|
|
}
|