diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:56:01 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:56:01 +0000 |
commit | 4c8ccdd48e1834ab2bcd11c769cb41be046a6516 (patch) | |
tree | 9af3f2d0575ddae191a100776bd00869ef4d276c /test | |
parent | f75a4d4477b9e1412ddce99975bcc78161ad69f4 (diff) |
Fixed up test dir WRT aliencode
Author: jgg
Date: 2000-05-13 04:23:01 GMT
Fixed up test dir WRT aliencode
Diffstat (limited to 'test')
-rw-r--r-- | test/makefile | 20 | ||||
-rw-r--r-- | test/uri.cc | 32 |
2 files changed, 32 insertions, 20 deletions
diff --git a/test/makefile b/test/makefile index 31d67d46c..e2f4c048f 100644 --- a/test/makefile +++ b/test/makefile @@ -24,29 +24,9 @@ LIB_MAKES = apt-pkg/makefile apt-inst/makefile SOURCE = scratch.cc include $(PROGRAM_H) -PROGRAM=testextract -SLIBS = -lapt-inst -lapt-pkg -LIB_MAKES = apt-pkg/makefile apt-inst/makefile -SOURCE = testextract.cc -include $(PROGRAM_H) - # Version compare tester PROGRAM=versiontest SLIBS = -lapt-pkg LIB_MAKES = apt-pkg/makefile SOURCE = versiontest.cc include $(PROGRAM_H) - -# Version compare tester -PROGRAM=srcrfind -SLIBS = -lapt-pkg -LIB_MAKES = apt-pkg/makefile -SOURCE = srcrfind.cc -include $(PROGRAM_H) - -# Control Extracter tester -PROGRAM=extractcontrol -SLIBS = -lapt-pkg -lapt-inst -ldb2 -LIB_MAKES = apt-pkg/makefile -SOURCE = extractcontrol.cc -include $(PROGRAM_H) diff --git a/test/uri.cc b/test/uri.cc new file mode 100644 index 000000000..6e5748ec6 --- /dev/null +++ b/test/uri.cc @@ -0,0 +1,32 @@ +#include <apt-pkg/strutl.h> +#include <stdio.h> + +void Test(const char *Foo) +{ + URI U(Foo); + + printf("%s a='%s' u='%s' p='%s' port='%u'\n h='%s' p='%s'\n", + Foo,U.Access.c_str(),U.User.c_str(),U.Password.c_str(), + U.Port,U.Host.c_str(),U.Path.c_str()); +} + +int main() +{ + // Basic stuff + Test("http://www.debian.org:90/temp/test"); + Test("http://jgg:foo@ualberta.ca/blah"); + Test("file:/usr/bin/foo"); + Test("cdrom:Moo Cow Rom:/debian"); + Test("gzip:./bar/cow"); + + // RFC 2732 stuff + Test("http://[1080::8:800:200C:417A]/foo"); + Test("http://[::FFFF:129.144.52.38]:80/index.html"); + Test("http://[::FFFF:129.144.52.38:]:80/index.html"); + Test("http://[::FFFF:129.144.52.38:]/index.html"); + + /* My Evil Corruption of RFC 2732 to handle CDROM names! Fun for + the whole family! */ + Test("cdrom:[The Debian 1.2 disk, 1/2 R1:6]/debian/"); + Test("cdrom:Foo Bar Cow/debian/"); +} |