Update Unicode docs
[factor/jcg.git] / basis / furnace / actions / actions-tests.factor
blob60a526fb247996f05a7ca0b91001628c50d28dc1
1 USING: kernel furnace.actions validators
2 tools.test math math.parser multiline namespaces http
3 io.streams.string http.server sequences splitting accessors ;
4 IN: furnace.actions.tests
6 <action>
7     [ "a" param "b" param [ string>number ] bi@ + ] >>display
8 "action-1" set
10 : lf>crlf "\n" split "\r\n" join ;
12 STRING: action-request-test-1
13 GET http://foo/bar?a=12&b=13 HTTP/1.1
15 blah
18 [ 25 ] [
19     action-request-test-1 lf>crlf
20     [ read-request ] with-string-reader
21     init-request
22     { } "action-1" get call-responder
23 ] unit-test
25 <action>
26     "a" >>rest
27     [ "a" param string>number sq ] >>display
28 "action-2" set
30 STRING: action-request-test-2
31 GET http://foo/bar/123 HTTP/1.1
33 blah
36 [ 25 ] [
37     action-request-test-2 lf>crlf
38     [ read-request ] with-string-reader
39     init-request
40     { "5" } "action-2" get call-responder
41 ] unit-test