define a method on stream-element-type, fix a bug in unlimited-input and add a unit test

db4
Doug Coleman 2009-09-28 15:51:40 -05:00
parent 1fb7cf37c4
commit 69229032c2
2 changed files with 12 additions and 2 deletions

View File

@ -81,4 +81,11 @@ IN: io.streams.limited.tests
"HELLO"
[ f stream-throws limit-input 4 read ]
with-string-reader
] unit-test
] unit-test
[ "asdf" ] [
"asdf" <string-reader> 2 stream-eofs <limited-stream> [
unlimited-input contents
] with-input-stream
] unit-test

View File

@ -37,7 +37,7 @@ M: decoder unlimited ( stream -- stream' )
[ stream>> ] change-stream ;
M: object unlimited ( stream -- stream' )
stream>> stream>> ;
stream>> ;
: limit-input ( limit mode -- )
[ input-stream ] 2dip '[ _ _ limit ] change ;
@ -103,3 +103,6 @@ M: limited-stream stream-seek
M: limited-stream dispose
stream>> dispose ;
M: limited-stream stream-element-type
stream>> stream-element-type ;