]> gitweb.factorcode.org Git - factor.git/commitdiff
cgi: fix for LH{ } changes.
authorJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Nov 2015 21:06:23 +0000 (13:06 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 4 Nov 2015 21:06:23 +0000 (13:06 -0800)
extra/cgi/cgi-tests.factor
extra/cgi/cgi.factor

index 6940a3c1897952145acb1dba8259a55680ffc0cf..8c535bd077547b24f11de0582709b05b1cb9edf6 100644 (file)
@@ -1,19 +1,17 @@
 ! Copyright (C) 2009 John Benediktsson
 ! See http://factorcode.org/license.txt for BSD license
 
-USING: cgi cgi.private kernel tools.test ;
+USING: cgi cgi.private kernel linked-assocs tools.test ;
 
-{ t } [ H{ } "" (query-string) = ] unit-test
+{ LH{ } } [ "" (query-string) ] unit-test
 
-{ t } [ H{ { "a" { "1" } } { "b" { "2" } } }
-        "a=1&b=2" (query-string) = ] unit-test
+{ LH{ { "a" { "1" } } { "b" { "2" } } } }
+[ "a=1&b=2" (query-string) ] unit-test
 
-{ t } [ H{ { "a" { "1" } } { "b" { "2" "3" } } }
-        "a=1&b=2&b=3" (query-string) = ] unit-test
+{ LH{ { "a" { "1" } } { "b" { "2" "3" } } } }
+[ "a=1&b=2&b=3" (query-string) ] unit-test
 
-{ t } [ "text/html" (content-type)
-        [ H{ } = ] [ "text/html" = ] bi* and ] unit-test
+{ LH{ } "text/html" } [ "text/html" (content-type) ] unit-test
 
-{ t } [ "text/html; charset=utf-8" (content-type)
-        [ H{ { "charset" { "utf-8" } } } = ]
-        [ "text/html" = ] bi* and ] unit-test
+{ LH{ { "charset" { "utf-8" } } } "text/html" }
+[ "text/html; charset=utf-8" (content-type) ] unit-test
index 10ec32720d24b4bed99bc166cc8f694dcfeca329..eefe653960a6d59860361543ef27060a587e2fe5 100644 (file)
@@ -2,8 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license
 
 USING: arrays assocs combinators environment io kernel
-math.parser regexp sequences splitting strings unicode.case
-urls.encoding ;
+linked-assocs math.parser regexp sequences splitting strings
+unicode.case urls.encoding ;
 
 IN: cgi
 
@@ -20,7 +20,7 @@ IN: cgi
 
 : (content-type) ( string -- params media/type )
     ";" split unclip [
-        [ H{ } clone ] [ first (query-string) ] if-empty
+        [ LH{ } clone ] [ first (query-string) ] if-empty
     ] dip ;
 
 : (multipart) ( -- assoc )