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

29 lines
964 B
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 ;
2007-09-20 18:09:08 -04:00
[ "localhost" 80 ] [ "localhost" parse-host ] unit-test
[ "localhost" 8888 ] [ "localhost:8888" parse-host ] unit-test
2008-02-25 15:53:18 -05:00
[ "/foo" "localhost" 8888 ] [ "http://localhost:8888/foo" parse-url ] unit-test
[ "/" "localhost" 8888 ] [ "http://localhost:8888" parse-url ] unit-test
[ "foo.txt" ] [ "http://www.paulgraham.com/foo.txt" download-name ] unit-test
[ "foo.txt" ] [ "http://www.arcsucks.com/foo.txt?xxx" download-name ] unit-test
[ "foo.txt" ] [ "http://www.arcsucks.com/foo.txt/" download-name ] unit-test
[ "www.arcsucks.com" ] [ "http://www.arcsucks.com////" download-name ] unit-test
2008-02-25 15:53:18 -05:00
[
TUPLE{ request
method: "GET"
host: "www.apple.com"
path: "/index.html"
port: 80
2008-02-29 01:57:38 -05:00
version: "1.1"
cookies: V{ }
2008-03-15 07:22:47 -04:00
header: H{ }
2008-02-25 15:53:18 -05:00
}
] [
[
"http://www.apple.com/index.html"
<get-request>
] with-scope
] unit-test