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