factor/extra/http/server/callbacks/callbacks-tests.factor

69 lines
1.5 KiB
Factor
Raw Normal View History

2008-03-11 04:39:09 -04:00
IN: http.server.callbacks
USING: http.server.actions http.server.callbacks accessors
http.server http tools.test namespaces io fry sequences
splitting kernel hashtables continuations ;
[ 123 ] [
[
2008-04-27 07:37:02 -04:00
init-request
2008-03-11 04:39:09 -04:00
<request> "GET" >>method request set
[
exit-continuation set
2008-04-25 04:23:47 -04:00
{ }
2008-03-11 17:03:22 -04:00
<action> [ [ "hello" print 123 ] show-final ] >>display
2008-03-11 04:39:09 -04:00
<callback-responder>
call-responder
] callcc1
] with-scope
] unit-test
[
2008-04-27 07:37:02 -04:00
init-request
2008-03-11 04:39:09 -04:00
<action> [
[
"hello" print
2008-05-01 17:24:50 -04:00
'[ , write ] <html-content>
2008-03-11 04:39:09 -04:00
] show-page
"byebye" print
[ 123 ] show-final
2008-03-11 17:03:22 -04:00
] >>display
2008-03-11 04:39:09 -04:00
<callback-responder> "r" set
[ 123 ] [
[
exit-continuation set
<request> "GET" >>method request set
2008-04-25 04:23:47 -04:00
{ } "r" get call-responder
2008-03-11 04:39:09 -04:00
] callcc1
body>> first
<request>
"GET" >>method
swap cont-id associate >>query
"/" >>path
request set
[
exit-continuation set
2008-04-25 04:23:47 -04:00
{ }
2008-03-11 04:39:09 -04:00
"r" get call-responder
] callcc1
! get-post-get
<request>
"GET" >>method
swap "location" header "=" last-split1 nip cont-id associate >>query
"/" >>path
request set
[
exit-continuation set
2008-04-25 04:23:47 -04:00
{ }
2008-03-11 04:39:09 -04:00
"r" get call-responder
] callcc1
] unit-test
] with-scope