summaryrefslogtreecommitdiff
path: root/test/ruby/test_io.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-23 02:14:07 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-23 02:14:07 +0000
commitded54cb8608ac277a7fbf9d8ff1825bbb25c650a (patch)
treed9aa88f17dd285f323e7e6ceb9e56e57a966cc95 /test/ruby/test_io.rb
parenta4eaf5f37c2364c5daada0e8d5aa3462501f2d0c (diff)
test_io.rb: test for write
* test/ruby/test_io.rb (TestIO#test_write_32bit_boundary): add test for write part. [ruby-core:55098] [Bug #8431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_io.rb')
-rw-r--r--test/ruby/test_io.rb28
1 files changed, 24 insertions, 4 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index ca741f8a23..30c482f4e6 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -2674,13 +2674,33 @@ End
}, bug8080
end
- def test_seek_32bit_boundary
+ def test_read_32bit_boundary
bug8431 = '[ruby-core:55098] [Bug #8431]'
make_tempfile {|t|
- assert_ruby_status(["-e", <<-"end;", t.path], "", bug8431)
- f = ARGF.to_io
+ assert_separately(["-", bug8431, t.path], <<-"end;")
+ msg = ARGV.shift
+ f = open(ARGV[0], "rb")
f.seek(0xffff_ffff)
- f.read(1)
+ assert_nil(f.read(1), msg)
+ end;
+ }
+ end
+
+ def test_write_32bit_boundary
+ bug8431 = '[ruby-core:55098] [Bug #8431]'
+ make_tempfile {|t|
+ assert_separately(["-", bug8431, t.path], <<-"end;", timeout: 30)
+ msg = ARGV.shift
+ f = open(ARGV[0], "wb")
+ f.seek(0xffff_ffff)
+ begin
+ # this will consume very long time or fail by ENOSPC on a
+ # filesystem which sparse file is not supported
+ f.write('1')
+ rescue SystemCallError
+ else
+ assert_equal(0x1_0000_0000, f.tell, msg)
+ end
end;
}
end