| # 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: |
| 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] (and 1 more errors) |
| 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] |
| |