refix the point is seek
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e3a57e06de
commit
856dc678f8
@ -1693,8 +1693,10 @@ class TestIO < Test::Unit::TestCase
|
|||||||
if defined?(IO::SEEK_DATA)
|
if defined?(IO::SEEK_DATA)
|
||||||
open(t.path) { |f|
|
open(t.path) { |f|
|
||||||
assert_equal("foo\n", f.gets)
|
assert_equal("foo\n", f.gets)
|
||||||
|
assert_nothing_raised("cannot SEEK_DATA on FS(0x%X)" % f.statfs.type) do
|
||||||
f.seek(0, IO::SEEK_DATA)
|
f.seek(0, IO::SEEK_DATA)
|
||||||
assert_equal("foo\nbar\nbaz\n", f.read, "cannot SEEK_DATA at fs(#{f.statfs.type})")
|
end
|
||||||
|
assert_equal("foo\nbar\nbaz\n", f.read)
|
||||||
}
|
}
|
||||||
open(t.path, 'r+') { |f|
|
open(t.path, 'r+') { |f|
|
||||||
pos = f.pos
|
pos = f.pos
|
||||||
@ -1739,8 +1741,10 @@ class TestIO < Test::Unit::TestCase
|
|||||||
if defined?(IO::SEEK_DATA)
|
if defined?(IO::SEEK_DATA)
|
||||||
open(t.path) { |f|
|
open(t.path) { |f|
|
||||||
assert_equal("foo\n", f.gets)
|
assert_equal("foo\n", f.gets)
|
||||||
|
assert_nothing_raised("cannot SEEK_DATA on FS(0x%X)" % f.statfs.type) do
|
||||||
f.seek(0, :DATA)
|
f.seek(0, :DATA)
|
||||||
assert_equal("foo\nbar\nbaz\n", f.read, "cannot SEEK_DATA at fs(#{f.statfs.type})")
|
end
|
||||||
|
assert_equal("foo\nbar\nbaz\n", f.read)
|
||||||
}
|
}
|
||||||
open(t.path, 'r+') { |f|
|
open(t.path, 'r+') { |f|
|
||||||
pos = f.pos
|
pos = f.pos
|
||||||
|
Loading…
x
Reference in New Issue
Block a user