Attachment "uri.test.diff" to
ticket [936064ffff]
added by
mic42
2004-04-16 10:09:42.
Index: uri.test
===================================================================
RCS file: /cvsroot/tcllib/tcllib/modules/uri/uri.test,v
retrieving revision 1.17
diff -u -b -r1.17 uri.test
--- uri.test 15 Jan 2004 06:36:14 -0000 1.17
+++ uri.test 16 Apr 2004 02:42:52 -0000
@@ -14,7 +14,7 @@
}
set dirname [file dirname [info script]]
source [file join $dirname uri.tcl]
-package require uri
+#package require uri
puts "uri [package present uri]"
@@ -34,19 +34,19 @@
test uri-1.1 {uri::split - http w/- query} {
eval kvsort [uri::split http://test.net/path/path2?query]
-} {host test.net path path/path2 port {} query query scheme http}
+} {host test.net path path/path2 port {} pwd {} query query scheme http user {}}
test uri-1.2 {uri::split - https w/- query} {
eval kvsort [uri::split https://test.net/path/path2?query]
-} {host test.net path path/path2 port {} query query scheme https}
+} {host test.net path path/path2 port {} pwd {} query query scheme https user {}}
test uri-1.3 {uri::split - http w/- port} {
eval kvsort [uri::split http://test.net:8080]
-} {host test.net path {} port 8080 query {} scheme http}
+} {host test.net path {} port 8080 pwd {} query {} scheme http user {}}
test uri-1.4 {uri::split - https w/- port} {
eval kvsort [uri::split https://test.net:8888]
-} {host test.net path {} port 8888 query {} scheme https}
+} {host test.net path {} port 8888 pwd {} query {} scheme https user {}}
test uri-1.5 {uri::split - ftp} {
eval kvsort [uri::split ftp://ftp.test.net/path/to/resource]
@@ -72,6 +72,11 @@
eval kvsort [uri::split {news:comp.lang.tcl}]
} {newsgroup-name comp.lang.tcl scheme news}
+test uri-1.11 {uri::split - http with userinfo} {
+ eval kvsort [uri::split {http://user:passwd@localhost/a/b/c.d}]
+} {host localhost path a/b/c.d port {} pwd passwd query {} scheme http user user}
+
+
# -------------------------------------------------------------------------
test uri-2.1 {uri::join - http} {
@@ -140,6 +145,14 @@
test uri-2.16 {uri::join - news newsgroup-name} {
eval uri::join scheme news newsgroup-name comp.lang.tcl
} {news:comp.lang.tcl}
+
+test uri-2.17 {uri::join - http userinfo} {
+ eval uri::join scheme http user user pwd passwd host localhost
+} {http://user:passwd@localhost/}
+
+test uri-2.17 {uri::join - http userinfo} {
+ eval uri::join scheme http user user host localhost
+} {http://user@localhost/}
# -------------------------------------------------------------------------