]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/http/client/client-tests.factor
core: subseq-index? -> subseq-of?
[factor.git] / basis / http / client / client-tests.factor
index ceab96a6d96bb6de01d752dfcc774d656879ed4d..49b897180e86c942f75e17db7119fa77e1fb8a7c 100644 (file)
@@ -1,5 +1,6 @@
 USING: accessors http http.client http.client.private
-io.streams.string kernel namespaces sequences tools.test urls ;
+io.streams.string kernel namespaces sequences splitting
+tools.test urls ;
 IN: http.client.tests
 
 { "foo.txt" } [ "http://www.paulgraham.com/foo.txt" download-name ] unit-test
@@ -14,7 +15,7 @@ IN: http.client.tests
         { method "GET" }
         { version "1.1" }
         { cookies V{ } }
-        { header H{ { "connection" "close" } { "user-agent" "Factor http.client" } } }
+        { header H{ { "Connection" "close" } { "User-Agent" "Factor http.client" } } }
         { redirects 10 }
     }
 } [
@@ -29,7 +30,7 @@ IN: http.client.tests
         { method "GET" }
         { version "1.1" }
         { cookies V{ } }
-        { header H{ { "connection" "close" } { "user-agent" "Factor http.client" } } }
+        { header H{ { "Connection" "close" } { "User-Agent" "Factor http.client" } } }
         { redirects 10 }
     }
 } [
@@ -47,8 +48,8 @@ IN: http.client.tests
 ! hit the velox.ch website.
 ! { t } [
     ! "https://alice.sni.velox.ch" http-get nip
-    ! [ "Great!" swap subseq? ]
-    ! [ "TLS SNI Test Site: alice.sni.velox.ch" swap subseq? ] bi and
+    ! [ "Great!" subseq-of? ]
+    ! [ "TLS SNI Test Site: alice.sni.velox.ch" subseq-of? ] bi and
 ! ] unit-test
 
 { t } [
@@ -58,7 +59,7 @@ IN: http.client.tests
         "content-type: text/html; charset=UTF-8"
         "date: Wed, 12 Oct 2011 18:57:49 GMT"
         "server: Factor http.server"
-    } [ "\n" join ] [ "\r\n" join ] bi
+    } [ join-lines ] [ "\r\n" join ] bi
     [ [ read-response ] with-string-reader ] same?
 ] unit-test