[前][次][番号順一覧][スレッド一覧]

ruby-changes:28843

From: nobu <ko1@a...>
Date: Thu, 23 May 2013 11:16:32 +0900 (JST)
Subject: [ruby-changes:28843] nobu:r40894 (trunk): test_io.rb: test for write

nobu	2013-05-23 11:14:07 +0900 (Thu, 23 May 2013)

  New Revision: 40894

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40894

  Log:
    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]

  Modified files:
    trunk/test/ruby/test_io.rb

Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 40893)
+++ test/ruby/test_io.rb	(revision 40894)
@@ -2674,13 +2674,33 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2674
   }, 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]