2 USING: urls urls.private tools.test
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/"
86 [ 1array ] [ [ >url ] curry ] bi* unit-test
90 swap [ 1array ] [ [ present ] curry ] bi* unit-test
93 [ "b" ] [ "a" "b" url-append-path ] unit-test
95 [ "a/b" ] [ "a/c" "b" url-append-path ] unit-test
97 [ "a/b" ] [ "a/" "b" url-append-path ] unit-test
99 [ "/b" ] [ "a" "/b" url-append-path ] unit-test
101 [ "/b" ] [ "a/b/" "/b" url-append-path ] unit-test
103 [ "/xxx/bar" ] [ "/xxx/baz" "bar" url-append-path ] unit-test
108 { host "www.apple.com" }
115 { host "www.apple.com" }
130 { host "www.apple.com" }
132 { path "/a/path/relative/path" }
133 { query H{ { "a" "b" } } }
139 { host "www.apple.com" }
145 { path "relative/path" }
146 { query H{ { "a" "b" } } }
156 { host "www.apple.com" }
158 { path "/a/path/relative/path" }
159 { query H{ { "a" "b" } } }
165 { host "www.apple.com" }
171 { path "relative/path" }
172 { query H{ { "a" "b" } } }
182 { host "www.apple.com" }
188 { host "www.apple.com" }
200 <url> "a" "b" set-query-param "b" query-param
203 [ "foo#3" ] [ URL" foo" clone 3 >>anchor present ] unit-test
205 [ "http://www.foo.com/" ] [ "http://www.foo.com:80" >url present ] unit-test
207 [ f ] [ URL" /gp/redirect.html/002-7009742-0004012?location=http://advantage.amazon.com/gp/vendor/public/join%26token%3d77E3769AB3A5B6CF611699E150DC33010761CE12" protocol>> ] unit-test
213 { query H{ { "foo" "bar" } } }
217 [ "http://localhost?foo=bar" >url ] unit-test
223 { query H{ { "foo" "bar" } } }
227 [ "http://localhost/?foo=bar" >url ] unit-test
229 [ "/" ] [ "http://www.jedit.org" >url path>> ] unit-test