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

ruby-changes:33702

From: nobu <ko1@a...>
Date: Fri, 2 May 2014 11:33:00 +0900 (JST)
Subject: [ruby-changes:33702] nobu:r45783 (trunk): test_io.rb: defer f_type

nobu	2014-05-02 11:32:53 +0900 (Fri, 02 May 2014)

  New Revision: 45783

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

  Log:
    test_io.rb: defer f_type
    
    * test/ruby/test_io.rb (test_seek, test_seek_symwhence): defer
      File::Statfs#type call which may not be implemented, to mitigate
      errors on platforms where SEEK_DATA is available but f_type in
      struct statfs is not.  [ruby-dev:48154] [Bug #9789]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45782)
+++ ChangeLog	(revision 45783)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri May  2 11:32:51 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/ruby/test_io.rb (test_seek, test_seek_symwhence): defer
+	  File::Statfs#type call which may not be implemented, to mitigate
+	  errors on platforms where SEEK_DATA is available but f_type in
+	  struct statfs is not.  [ruby-dev:48154] [Bug #9789]
+
 Fri May  2 10:37:55 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* parse.y (rb_id_attrset): turn dynamically interned Symbol into
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 45782)
+++ test/ruby/test_io.rb	(revision 45783)
@@ -1715,7 +1715,7 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1715
         open(t.path) { |f|
           break unless can_seek_data(f)
           assert_equal("foo\n", f.gets)
-          assert_nothing_raised("cannot SEEK_DATA on FS(0x%X)" % f.statfs.type) do
+          assert_nothing_raised(proc {"cannot SEEK_DATA on FS(0x%X)" % f.statfs.type}) do
             f.seek(0, IO::SEEK_DATA)
           end
           assert_equal("foo\nbar\nbaz\n", f.read)
@@ -1765,7 +1765,7 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L1765
         open(t.path) { |f|
           break unless can_seek_data(f)
           assert_equal("foo\n", f.gets)
-          assert_nothing_raised("cannot SEEK_DATA on FS(0x%X)" % f.statfs.type) do
+          assert_nothing_raised(proc {"cannot SEEK_DATA on FS(0x%X)" % f.statfs.type}) do
             f.seek(0, :DATA)
           end
           assert_equal("foo\nbar\nbaz\n", f.read)

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

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