blob: 19636046a9980aee8ed9061a3ea1990af76f087c [file] [log] [blame]
# generated from the original tests.
# Henceforth it may be nicer to group tests into separate files.
-- in.cue --
import "net"
t1: net.FQDN & "foo.bar."
t2: net.FQDN("foo.bararararararararararararararararararararararararararararararararara")
t3: net.SplitHostPort("[::%lo0]:80")
t4: net.JoinHostPort("example.com", "80")
t5: net.JoinHostPort("2001:db8::1", 80)
t6: net.JoinHostPort([192,30,4,2], 80)
t7: net.JoinHostPort([192, 30, 4], 80)
t8: net.IP("23.23.23.23")
t9: net.IPv4 & "23.23.23.2333"
t10: net.IP("23.23.23.23")
t11: net.IP("2001:db8::1")
t12: net.IPv4("2001:db8::1")
t13: net.IPv4() & "ff02::1:3"
t14: net.LoopbackIP([127, 0, 0, 1])
t15: net.LoopbackIP("127.0.0.1")
t16: net.ToIP4("127.0.0.1")
t17: net.ToIP16("127.0.0.1")
-- out/net --
Errors:
t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4):
./in.cue:11:16
error in call to net.JoinHostPort: invalid host [192, 30, 4]:
./in.cue:9:5
t13: invalid value "ff02::1:3" (does not satisfy net.IPv4):
./in.cue:15:6
./in.cue:15:19
Result:
t1: "foo.bar."
t2: false
t3: ["::%lo0", "80"]
t4: "example.com:80"
t5: "[2001:db8::1]:80"
t6: "192.30.4.2:80"
t7: _|_ // error in call to net.JoinHostPort: invalid host [192, 30, 4]
t8: true
t9: _|_ // t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4)
t10: true
t11: true
t12: false
t13: _|_ // t13: invalid value "ff02::1:3" (does not satisfy net.IPv4)
t14: true
t15: true
t16: [127, 0, 0, 1]
t17: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 127, 0, 0, 1]