]> gitweb.factorcode.org Git - factor.git/blob - basis/http/client/client-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / http / client / client-tests.factor
1 USING: http.client http.client.private http tools.test
2 namespaces urls ;
3 IN: http.client.tests
4
5 [ "localhost" f ] [ "localhost" parse-host ] unit-test
6 [ "localhost" 8888 ] [ "localhost:8888" parse-host ] unit-test
7
8 [ "foo.txt" ] [ "http://www.paulgraham.com/foo.txt" download-name ] unit-test
9 [ "foo.txt" ] [ "http://www.arc.com/foo.txt?xxx" download-name ] unit-test
10 [ "foo.txt" ] [ "http://www.arc.com/foo.txt/" download-name ] unit-test
11 [ "www.arc.com" ] [ "http://www.arc.com////" download-name ] unit-test
12
13 [
14     T{ request
15         { url T{ url { protocol "http" } { host "www.apple.com" } { port 80 } { path "/index.html" } } }
16         { method "GET" }
17         { version "1.1" }
18         { cookies V{ } }
19         { header H{ { "connection" "close" } { "user-agent" "Factor http.client" } } }
20         { redirects 10 }
21     }
22 ] [
23     "http://www.apple.com/index.html"
24     <get-request>
25 ] unit-test
26
27 [
28     T{ request
29         { url T{ url { protocol "https" } { host "www.amazon.com" } { port 443 } { path "/index.html" } } }
30         { method "GET" }
31         { version "1.1" }
32         { cookies V{ } }
33         { header H{ { "connection" "close" } { "user-agent" "Factor http.client" } } }
34         { redirects 10 }
35     }
36 ] [
37     "https://www.amazon.com/index.html"
38     <get-request>
39 ] unit-test