From e96274f604f564b8480757acbee5202b39ea5a22 Mon Sep 17 00:00:00 2001 From: normal Date: Sun, 16 Nov 2014 02:09:22 +0000 Subject: test/ruby/test_io.rb: remove unnecessary begin/end Unnecessary since r47422 when the "rescue IOError" clause was removed. * test/ruby/test_io.rb (test_readpartial_locktmp): remove unnecessary begin/end git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/ruby/test_io.rb | 34 ++++++++++++++++------------------ 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index a961a90ac9..6e958af506 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Nov 16 11:07:25 2014 Eric Wong + + * test/ruby/test_io.rb (test_readpartial_locktmp): + remove unnecessary begin/end + Sun Nov 16 00:45:23 2014 Tanaka Akira * common.mk: Specify dependencies for generated C sources. diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 2d8072a830..39f357a6b9 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2927,27 +2927,25 @@ End data = "a" * 100 th = nil with_pipe do |r,w| - begin - r.nonblock = true - th = Thread.new {r.readpartial(100, buf)} + r.nonblock = true + th = Thread.new {r.readpartial(100, buf)} - Thread.pass until th.stop? + Thread.pass until th.stop? - assert_equal 100, buf.bytesize + assert_equal 100, buf.bytesize - begin - buf.replace("") - rescue RuntimeError => e - assert_match(/can't modify string; temporarily locked/, e.message) - Thread.pass - end until buf.empty? - - assert_empty(buf, bug6099) - assert_predicate(th, :alive?) - w.write(data) - Thread.pass while th.alive? - th.join - end + begin + buf.replace("") + rescue RuntimeError => e + assert_match(/can't modify string; temporarily locked/, e.message) + Thread.pass + end until buf.empty? + + assert_empty(buf, bug6099) + assert_predicate(th, :alive?) + w.write(data) + Thread.pass while th.alive? + th.join end assert_equal(data, buf, bug6099) end -- cgit v1.2.3