Skip to content

Commit

Permalink
io.streams.tee: adding stream-element-type
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjbq7 committed May 1, 2024
1 parent abea585 commit 973c929
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions extra/io/streams/tee/tee-tests.factor
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
USING: io io.encodings.utf8 io.files io.streams.tee kernel
tools.test ;
USING: arrays io io.encodings.utf8 io.files io.streams.tee
kernel tools.test ;

{ t } [
"resource:LICENSE.txt" utf8 [
[
utf8
[ tee-to-file-writer read-contents ]
[ file-contents ] 2bi =
utf8 [
tee-to-file-writer
readln 42 read read-contents 3array
]
[
[ readln 42 read read-contents 3array ] with-file-reader
] 2bi =
] with-test-file
] with-file-reader
] unit-test
2 changes: 2 additions & 0 deletions extra/io/streams/tee/tee.factor
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ MACRO: tee2 ( read-quot write-quot -- quot )

PRIVATE>

M: tee-stream stream-element-type in>> stream-element-type ;

M: tee-stream stream-read1
[ stream-read1 ] [ stream-write1 ] tee1 ;

Expand Down

0 comments on commit 973c929

Please sign in to comment.