]> gitweb.factorcode.org Git - factor.git/commitdiff
add unit test, fix bounds check error in limited streams
authorU-C4\Administrator <Administrator@k.(none)>
Tue, 20 Jan 2009 00:19:12 +0000 (18:19 -0600)
committerU-C4\Administrator <Administrator@k.(none)>
Tue, 20 Jan 2009 00:19:12 +0000 (18:19 -0600)
basis/io/streams/limited/limited-tests.factor
basis/io/streams/limited/limited.factor [changed mode: 0644->0755]

index eb5b9212607a3fb8cac46d9dd3bea444c04f6fbd..40f2c81c9a9eb7481a013bfac3483cf9468b3990 100644 (file)
@@ -38,3 +38,6 @@ namespaces tools.test strings kernel ;
         "l" read-until
     ] with-input-stream
 ] unit-test
+
+[ CHAR: a ]
+[ "a" <string-reader> 1 <limited-stream> stream-read1 ] unit-test
old mode 100644 (file)
new mode 100755 (executable)
index ecc4992..51d6b54
@@ -24,7 +24,7 @@ ERROR: limit-exceeded ;
 
 : check-limit ( n stream -- )
     [ + ] change-count
-    [ count>> ] [ limit>> ] bi >=
+    [ count>> ] [ limit>> ] bi >
     [ limit-exceeded ] when ; inline
 
 M: limited-stream stream-read1