]> gitweb.factorcode.org Git - factor.git/blob - basis/furnace/actions/actions-tests.factor
Fix permission bits
[factor.git] / basis / furnace / actions / actions-tests.factor
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
5
6 <action>
7     [ "a" param "b" param [ string>number ] bi@ + ] >>display
8 "action-1" set
9
10 : lf>crlf "\n" split "\r\n" join ;
11
12 STRING: action-request-test-1
13 GET http://foo/bar?a=12&b=13 HTTP/1.1
14
15 blah
16 ;
17
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
24
25 <action>
26     "a" >>rest
27     [ "a" param string>number sq ] >>display
28 "action-2" set
29
30 STRING: action-request-test-2
31 GET http://foo/bar/123 HTTP/1.1
32
33 blah
34 ;
35
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