tests/hostname2ip.r

library(getip)

### should not work
test = try(hostname2ip(1:10), silent=TRUE)
stopifnot(inherits(test, "try-error"))

test = try(hostname2ip("asdf"), silent=TRUE)
stopifnot(inherits(test, "try-error"))



### should work
hosts = "localhost"
test = hostname2ip(hosts)[[1]][1]
stopifnot(identical(test, "127.0.0.1"))
wrathematics/getip documentation built on Jan. 28, 2024, 12:12 p.m.