diff --git a/basis/io/streams/throwing/throwing-tests.factor b/basis/io/streams/throwing/throwing-tests.factor index f7b7dc52b8..1e7cc1cd2b 100644 --- a/basis/io/streams/throwing/throwing-tests.factor +++ b/basis/io/streams/throwing/throwing-tests.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2010 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: io io.streams.limited io.streams.string -io.streams.throwing tools.test ; +io.streams.throwing tools.test kernel ; IN: io.streams.throwing.tests [ "as" ] @@ -34,3 +34,13 @@ IN: io.streams.throwing.tests "asdf" 2 [ contents contents ] throws-on-eof ] [ stream-exhausted? ] must-fail-with + +[ + "asdf" 2 + [ 1 seek-absolute seek-input 4 read drop ] throws-on-eof +] [ stream-exhausted? ] must-fail-with + +[ 1 ] [ + "asdf" 2 + [ 1 seek-absolute seek-input tell-input ] throws-on-eof +] unit-test diff --git a/basis/io/streams/throwing/throwing.factor b/basis/io/streams/throwing/throwing.factor index 3ad4d012f7..bc9adc66bf 100644 --- a/basis/io/streams/throwing/throwing.factor +++ b/basis/io/streams/throwing/throwing.factor @@ -28,6 +28,12 @@ M:: throws-on-eof stream-read-partial ( n stream -- seq ) n stream stream>> stream-read-partial [ n stream \ read-partial stream-exhausted ] unless* ; +M: throws-on-eof stream-tell + stream>> stream-tell ; + +M: throws-on-eof stream-seek + stream>> stream-seek ; + PRIVATE> : throws-on-eof ( stream quot -- )