2008-03-03 05:40:29 -05:00
|
|
|
IN: http.server.actions.tests
|
|
|
|
USING: http.server.actions tools.test math math.parser
|
|
|
|
multiline namespaces http io.streams.string http.server
|
2008-03-05 22:38:15 -05:00
|
|
|
sequences accessors ;
|
2008-03-03 05:40:29 -05:00
|
|
|
|
2008-03-05 22:38:15 -05:00
|
|
|
<action>
|
2008-03-11 04:39:09 -04:00
|
|
|
[ "a" get "b" get + ] >>display
|
2008-03-05 22:38:15 -05:00
|
|
|
{ { "a" [ string>number ] } { "b" [ string>number ] } } >>get-params
|
|
|
|
"action-1" set
|
2008-03-03 05:40:29 -05:00
|
|
|
|
|
|
|
STRING: action-request-test-1
|
|
|
|
GET http://foo/bar?a=12&b=13 HTTP/1.1
|
|
|
|
|
|
|
|
blah
|
|
|
|
;
|
|
|
|
|
|
|
|
[ 25 ] [
|
|
|
|
action-request-test-1 [ read-request ] with-string-reader
|
2008-03-11 04:39:09 -04:00
|
|
|
request set
|
2008-03-03 05:40:29 -05:00
|
|
|
"/blah"
|
|
|
|
"action-1" get call-responder
|
|
|
|
] unit-test
|
|
|
|
|
2008-03-05 22:38:15 -05:00
|
|
|
<action>
|
2008-03-11 04:39:09 -04:00
|
|
|
[ +path+ get "xxx" get "X" <repetition> concat append ] >>submit
|
2008-03-05 22:38:15 -05:00
|
|
|
{ { +path+ [ ] } { "xxx" [ string>number ] } } >>post-params
|
|
|
|
"action-2" set
|
2008-03-03 05:40:29 -05:00
|
|
|
|
|
|
|
STRING: action-request-test-2
|
|
|
|
POST http://foo/bar/baz HTTP/1.1
|
|
|
|
content-length: 5
|
2008-03-13 23:14:32 -04:00
|
|
|
content-type: application/x-www-form-urlencoded
|
2008-03-03 05:40:29 -05:00
|
|
|
|
|
|
|
xxx=4
|
|
|
|
;
|
|
|
|
|
|
|
|
[ "/blahXXXX" ] [
|
|
|
|
action-request-test-2 [ read-request ] with-string-reader
|
2008-03-11 04:39:09 -04:00
|
|
|
request set
|
2008-03-03 05:40:29 -05:00
|
|
|
"/blah"
|
|
|
|
"action-2" get call-responder
|
|
|
|
] unit-test
|