factor/basis/http/client/client-tests.factor

36 lines
1.2 KiB
Factor
Raw Normal View History

2008-02-25 15:53:18 -05:00
USING: http.client http.client.private http tools.test
tuple-syntax namespaces urls ;
2008-05-14 00:36:55 -04:00
[ "localhost" f ] [ "localhost" parse-host ] unit-test
2007-09-20 18:09:08 -04:00
[ "localhost" 8888 ] [ "localhost:8888" parse-host ] unit-test
[ "foo.txt" ] [ "http://www.paulgraham.com/foo.txt" download-name ] unit-test
[ "foo.txt" ] [ "http://www.arc.com/foo.txt?xxx" download-name ] unit-test
[ "foo.txt" ] [ "http://www.arc.com/foo.txt/" download-name ] unit-test
[ "www.arc.com" ] [ "http://www.arc.com////" download-name ] unit-test
2008-02-25 15:53:18 -05:00
[
TUPLE{ request
2008-06-02 16:00:03 -04:00
url: TUPLE{ url protocol: "http" host: "www.apple.com" port: 80 path: "/index.html" }
2008-02-25 15:53:18 -05:00
method: "GET"
2008-02-29 01:57:38 -05:00
version: "1.1"
cookies: V{ }
2008-06-16 04:34:17 -04:00
header: H{ { "connection" "close" } { "user-agent" "Factor http.client" } }
2008-02-25 15:53:18 -05:00
}
] [
2008-06-02 16:00:03 -04:00
"http://www.apple.com/index.html"
<get-request>
2008-02-25 15:53:18 -05:00
] unit-test
2008-05-14 00:36:55 -04:00
[
TUPLE{ request
2008-06-02 16:00:03 -04:00
url: TUPLE{ url protocol: "https" host: "www.amazon.com" port: 443 path: "/index.html" }
2008-05-14 00:36:55 -04:00
method: "GET"
version: "1.1"
cookies: V{ }
2008-06-16 04:34:17 -04:00
header: H{ { "connection" "close" } { "user-agent" "Factor http.client" } }
2008-05-14 00:36:55 -04:00
}
] [
2008-06-02 16:00:03 -04:00
"https://www.amazon.com/index.html"
<get-request>
2008-05-14 00:36:55 -04:00
] unit-test