blob: 7d76d17a24fdca4599fe49a8886e1dc33a249b4f [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:
error in call to net.JoinHostPort: invalid host [192, 30, 4]
t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4)
t13: invalid value "ff02::1:3" (does not satisfy net.IPv4):
./in.cue:15:6
Result:
(_|_){
// [eval]
t1: (string){ "foo.bar." }
t2: (bool){ false }
t3: (#list){
0: (string){ "::%lo0" }
1: (string){ "80" }
}
t4: (string){ "example.com:80" }
t5: (string){ "[2001:db8::1]:80" }
t6: (string){ "192.30.4.2:80" }
t7: (_|_){
// [eval] error in call to net.JoinHostPort: invalid host [192, 30, 4]
}
t8: (bool){ true }
t9: (_|_){
// [eval] t9: invalid value "23.23.23.2333" (does not satisfy net.IPv4)
}
t10: (bool){ true }
t11: (bool){ true }
t12: (bool){ false }
t13: (_|_){
// [eval] t13: invalid value "ff02::1:3" (does not satisfy net.IPv4):
// ./in.cue:15:6
}
t14: (bool){ true }
t15: (bool){ true }
t16: (#list){
0: (int){ 127 }
1: (int){ 0 }
2: (int){ 0 }
3: (int){ 1 }
}
t17: (#list){
0: (int){ 0 }
1: (int){ 0 }
2: (int){ 0 }
3: (int){ 0 }
4: (int){ 0 }
5: (int){ 0 }
6: (int){ 0 }
7: (int){ 0 }
8: (int){ 0 }
9: (int){ 0 }
10: (int){ 255 }
11: (int){ 255 }
12: (int){ 127 }
13: (int){ 0 }
14: (int){ 0 }
15: (int){ 1 }
}
}