diff --git a/basis/io/pipes/pipes-tests.factor b/basis/io/pipes/pipes-tests.factor index 3f46186869c..419af630d5f 100644 --- a/basis/io/pipes/pipes-tests.factor +++ b/basis/io/pipes/pipes-tests.factor @@ -81,3 +81,15 @@ io.timeouts kernel math namespaces threads tools.test ; [ 0 read ] with-input-stream ] with-destructors ] unit-test + +{ "bar" "foo" } [ + [ + [let + utf8 :> ( x y ) + x y [ &dispose drop ] bi@ + "foo\n" x stream-write x stream-flush + "bar\n" y stream-write y stream-flush + x y [ stream-readln ] bi@ + ] + ] with-destructors +] unit-test diff --git a/basis/io/pipes/pipes.factor b/basis/io/pipes/pipes.factor index f27131f9c42..327d3de84c6 100644 --- a/basis/io/pipes/pipes.factor +++ b/basis/io/pipes/pipes.factor @@ -24,6 +24,12 @@ HOOK: (pipe) io-backend ( -- pipe ) ] dip ] with-destructors ; +:: ( encoding -- stream stream ) + encoding :> x encoding :> y + x in>> :> xin y in>> :> yin + yin x in<< xin y in<< + x y ; +