2 USING: io.sockets io.sockets.secure urls urls.private tools.test prettyprint
3 arrays kernel assocs present accessors ;
10 { host "www.apple.com" }
13 { query H{ { "a" "b" } } }
16 "http://www.apple.com:1234/a/path?a=b#foo"
21 { host "www.apple.com" }
23 { query H{ { "a" "b" } } }
26 "http://www.apple.com/a/path?a=b#foo"
31 { host "www.apple.com" }
33 { path "/another/fine/path" }
36 "http://www.apple.com:1234/another/fine/path#foo"
40 { path "/a/relative/path" }
43 "/a/relative/path#foo"
47 { path "/a/relative/path" }
53 { path "a/relative/path" }
60 { query H{ { "a" "b" } } }
67 { host "ftp.kernel.org" }
71 "ftp://slava@ftp.kernel.org/"
76 { host "ftp.kernel.org" }
81 "ftp://slava:secret@ftp.kernel.org/"
88 { query H{ { "a" f } } }
95 [ 1array ] [ [ >url ] curry ] bi* unit-test
99 swap [ 1array ] [ [ present ] curry ] bi* unit-test
102 [ "b" ] [ "a" "b" url-append-path ] unit-test
104 [ "a/b" ] [ "a/c" "b" url-append-path ] unit-test
106 [ "a/b" ] [ "a/" "b" url-append-path ] unit-test
108 [ "/b" ] [ "a" "/b" url-append-path ] unit-test
110 [ "/b" ] [ "a/b/" "/b" url-append-path ] unit-test
112 [ "/xxx/bar" ] [ "/xxx/baz" "bar" url-append-path ] unit-test
117 { host "www.apple.com" }
124 { host "www.apple.com" }
139 { host "www.apple.com" }
141 { path "/a/path/relative/path" }
142 { query H{ { "a" "b" } } }
148 { host "www.apple.com" }
154 { path "relative/path" }
155 { query H{ { "a" "b" } } }
165 { host "www.apple.com" }
167 { path "/a/path/relative/path" }
168 { query H{ { "a" "b" } } }
174 { host "www.apple.com" }
180 { path "relative/path" }
181 { query H{ { "a" "b" } } }
191 { host "www.apple.com" }
197 { host "www.apple.com" }
211 { host "www.apple.com" }
216 { host "www.apple.com" }
222 { host "www.apple.com" }
228 ! Support //foo.com, which has the same protocol as the url we derive from
229 [ URL" http://foo.com" ]
230 [ URL" http://google.com" URL" //foo.com" derive-url ] unit-test
232 [ URL" https://foo.com" ]
233 [ URL" https://google.com" URL" //foo.com" derive-url ] unit-test
236 <url> "a" "b" set-query-param "b" query-param
239 [ "foo#3" ] [ URL" foo" clone 3 >>anchor present ] unit-test
241 [ "http://www.foo.com/" ] [ "http://www.foo.com:80" >url present ] unit-test
243 [ f ] [ URL" /gp/redirect.html/002-7009742-0004012?location=http://advantage.amazon.com/gp/vendor/public/join%26token%3d77E3769AB3A5B6CF611699E150DC33010761CE12" protocol>> ] unit-test
249 { query H{ { "foo" "bar" } } }
253 [ "http://localhost?foo=bar" >url ] unit-test
259 { query H{ { "foo" "bar" } } }
263 [ "http://localhost/?foo=bar" >url ] unit-test
265 [ "/" ] [ "http://www.jedit.org" >url path>> ] unit-test
267 [ "USING: urls ;\nURL\" foo\"" ] [ URL" foo" unparse-use ] unit-test
269 [ T{ inet { host "google.com" } { port 80 } } ]
270 [ URL" http://google.com/" url-addr ] unit-test
274 { addrspec T{ inet { host "google.com" } { port 443 } } }
277 [ URL" https://google.com/" url-addr ] unit-test