turi.nim 462 B

123456789101112131415161718
  1. discard """
  2. cmd: "nim c -r --styleCheck:hint --panics:on $options $file"
  3. targets: "c"
  4. nimout: ""
  5. action: "run"
  6. exitcode: 0
  7. timeout: 60.0
  8. """
  9. import uri
  10. block:
  11. let org = "udp://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8080"
  12. let url = parseUri(org)
  13. doAssert url.hostname == "2001:0db8:85a3:0000:0000:8a2e:0370:7334" # true
  14. let newUrl = parseUri($url)
  15. doAssert newUrl.hostname == "2001:0db8:85a3:0000:0000:8a2e:0370:7334" # true