]> gitweb.factorcode.org Git - factor.git/commitdiff
define a method on stream-element-type, fix a bug in unlimited-input and add a unit...
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 28 Sep 2009 20:51:40 +0000 (15:51 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 28 Sep 2009 20:51:40 +0000 (15:51 -0500)
basis/io/streams/limited/limited-tests.factor
basis/io/streams/limited/limited.factor

index 86d652d17c52e5d438e8ce7bfb929455ace4498d..f052be3b74c08a0df73b19db8f1ab5d59b551ffa 100644 (file)
@@ -81,4 +81,11 @@ IN: io.streams.limited.tests
     "HELLO"
     [ f stream-throws limit-input 4 read ]
     with-string-reader
-] unit-test
\ No newline at end of file
+] unit-test
+
+
+[ "asdf" ] [
+    "asdf" <string-reader> 2 stream-eofs <limited-stream> [
+        unlimited-input contents
+    ] with-input-stream
+] unit-test
index 1b0e155762a5caac91d6bb2878a30fb4c2f66d0e..c71e99ab91f91dbb1acb6c1083b5831578483a31 100755 (executable)
@@ -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 ;