2008-05-05 04:15:24 -04:00
|
|
|
USING: io io.pipes io.streams.string io.encodings.utf8
|
|
|
|
io.streams.duplex io.encodings namespaces continuations
|
|
|
|
tools.test kernel ;
|
2008-05-05 03:19:25 -04:00
|
|
|
IN: io.pipes.tests
|
|
|
|
|
|
|
|
[ "Hello" ] [
|
2008-05-05 04:15:24 -04:00
|
|
|
utf8 <pipe> [
|
|
|
|
"Hello" print flush
|
|
|
|
readln
|
|
|
|
] with-stream
|
2008-05-05 03:19:25 -04:00
|
|
|
] unit-test
|
|
|
|
|
2008-05-05 04:15:24 -04:00
|
|
|
[ { } ] [ { } with-pipeline ] unit-test
|
|
|
|
[ { f } ] [ { [ f ] } with-pipeline ] unit-test
|
|
|
|
[ { "Hello" } ] [
|
|
|
|
"Hello" [
|
|
|
|
{ [ input-stream [ utf8 <decoder> ] change readln ] } with-pipeline
|
|
|
|
] with-string-reader
|
|
|
|
] unit-test
|
2008-05-05 03:19:25 -04:00
|
|
|
|
|
|
|
[ { f "Hello" } ] [
|
|
|
|
{
|
2008-05-05 04:15:24 -04:00
|
|
|
[ output-stream [ utf8 <encoder> ] change "Hello" print flush f ]
|
|
|
|
[ input-stream [ utf8 <decoder> ] change readln ]
|
|
|
|
} with-pipeline
|
2008-05-05 03:19:25 -04:00
|
|
|
] unit-test
|