]> gitweb.factorcode.org Git - factor.git/blob - extra/cgi/cgi-tests.factor
e4f5ac77d28e408bdc1620abb877a3b8da1dd904
[factor.git] / extra / cgi / cgi-tests.factor
1 ! Copyright (C) 2009 John Benediktsson
2 ! See http://factorcode.org/license.txt for BSD license
3
4 USING: cgi cgi.private kernel tools.test ;
5
6 [ t ] [ H{ } "" (query-string) = ] unit-test
7
8 [ t ] [ H{ { "a" { "1" } } { "b" { "2" } } }
9         "a=1&b=2" (query-string) = ] unit-test
10
11 [ t ] [ H{ { "a" { "1" } } { "b" { "2" "3" } } }
12         "a=1&b=2&b=3" (query-string) = ] unit-test
13
14 [ t ] [ "text/html" (content-type)
15         [ H{ } = ] [ "text/html" = ] bi* and ] unit-test
16
17 [ t ] [ "text/html; charset=utf-8" (content-type)
18         [ H{ { "charset" { "utf-8" } } } = ]
19         [ "text/html" = ] bi* and ] unit-test