factor/extra/http/client/client-tests.factor

46 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 ;
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-05-14 00:36:55 -04:00
protocol: http
2008-02-25 15:53:18 -05:00
method: "GET"
host: "www.apple.com"
port: 80
2008-05-14 00:36:55 -04:00
path: "/index.html"
2008-02-29 01:57:38 -05:00
version: "1.1"
cookies: V{ }
header: H{ { "connection" "close" } }
2008-02-25 15:53:18 -05:00
}
] [
[
"http://www.apple.com/index.html"
<get-request>
] with-scope
] unit-test
2008-05-14 00:36:55 -04:00
[
TUPLE{ request
protocol: https
method: "GET"
host: "www.amazon.com"
port: 443
path: "/index.html"
version: "1.1"
cookies: V{ }
header: H{ { "connection" "close" } }
}
] [
[
"https://www.amazon.com/index.html"
<get-request>
] with-scope
] unit-test