You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1010 B

  1. #include <apt-pkg/strutl.h>
  2. #include <stdio.h>
  3. void Test(const char *Foo)
  4. {
  5. URI U(Foo);
  6. printf("%s a='%s' u='%s' p='%s' port='%u'\n h='%s' p='%s'\n",
  7. Foo,U.Access.c_str(),U.User.c_str(),U.Password.c_str(),
  8. U.Port,U.Host.c_str(),U.Path.c_str());
  9. }
  10. int main()
  11. {
  12. // Basic stuff
  13. Test("http://www.debian.org:90/temp/test");
  14. Test("http://jgg:foo@ualberta.ca/blah");
  15. Test("file:/usr/bin/foo");
  16. Test("cdrom:Moo Cow Rom:/debian");
  17. Test("gzip:./bar/cow");
  18. // RFC 2732 stuff
  19. Test("http://[1080::8:800:200C:417A]/foo");
  20. Test("http://[::FFFF:129.144.52.38]:80/index.html");
  21. Test("http://[::FFFF:129.144.52.38:]:80/index.html");
  22. Test("http://[::FFFF:129.144.52.38:]/index.html");
  23. /* My Evil Corruption of RFC 2732 to handle CDROM names! Fun for
  24. the whole family! */
  25. Test("cdrom:[The Debian 1.2 disk, 1/2 R1:6]/debian/");
  26. Test("cdrom:Foo Bar Cow/debian/");
  27. Test("ftp:ftp.fr.debian.org/debian/pool/main/x/xtel/xtel_3.2.1-15_i386.deb");
  28. }