factor/extra/cgi/cgi-tests.factor

18 lines
527 B
Factor
Raw Normal View History

! Copyright (C) 2009 John Benediktsson
! See http://factorcode.org/license.txt for BSD license
2015-11-04 16:06:23 -05:00
USING: cgi cgi.private kernel linked-assocs tools.test ;
2017-02-06 19:22:07 -05:00
{ LH{ } } [ "" query-string ] unit-test
2015-11-04 16:06:23 -05:00
{ LH{ { "a" { "1" } } { "b" { "2" } } } }
2017-02-06 19:22:07 -05:00
[ "a=1&b=2" query-string ] unit-test
2015-11-04 16:06:23 -05:00
{ LH{ { "a" { "1" } } { "b" { "2" "3" } } } }
2017-02-06 19:22:07 -05:00
[ "a=1&b=2&b=3" query-string ] unit-test
2017-02-06 19:22:07 -05:00
{ LH{ } "text/html" } [ "text/html" content-type ] unit-test
2015-11-04 16:06:23 -05:00
{ LH{ { "charset" { "utf-8" } } } "text/html" }
2017-02-06 19:22:07 -05:00
[ "text/html; charset=utf-8" content-type ] unit-test