USING: accessors io io.streams.string kernel math parser sbufs
-sequences tools.test words ;
+sequences tools.test words namespaces ;
IN: io.tests
{ f } [
{ SBUF" asdf" }
[ "asdf" <string-reader> 4 <sbuf> [ stream-copy ] keep ] unit-test
+
+[ "asdf" ]
+[
+ [
+ [ "asdf" error-stream get stream-write ] with-error>output
+ ] with-string-writer
+] unit-test
+
+[ "asdf" ]
+[
+ <string-writer> [
+ [
+ [ "asdf" output-stream get stream-write ] with-output>error
+ ] with-error-stream
+ ] keep >string
+] unit-test
\ No newline at end of file
: with-output>error ( quot -- )
error-stream get swap with-output-stream* ; inline
+: with-error>output ( quot -- )
+ output-stream get swap with-error-stream* ; inline
+
: with-streams* ( input output quot -- )
swapd [ with-output-stream* ] curry with-input-stream* ; inline