ruby-changes:56740
From: Kazuhiro <ko1@a...>
Date: Thu, 1 Aug 2019 09:14:26 +0900 (JST)
Subject: [ruby-changes:56740] Kazuhiro NISHIYAMA: 67f7e5a224 (master): Compact ensure clause and rename variables to fix alignment
https://git.ruby-lang.org/ruby.git/commit/?id=67f7e5a224 From 67f7e5a224bc31e1625023ce1ed5cfbd54ea1d8f Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Thu, 1 Aug 2019 09:12:08 +0900 Subject: Compact ensure clause and rename variables to fix alignment diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index f91b8c8..247e4a7 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -117,23 +117,23 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L117 EnvUtil.with_default_internal(Encoding::UTF_8) do EnvUtil.with_default_external(Encoding::UTF_8) do begin - reader, writer = IO.pipe - reader.binmode - writer.binmode + reader0, writer0 = IO.pipe + reader0.binmode + writer0.binmode reader1, writer1 = IO.pipe reader2, writer2 = IO.pipe(binmode: true) - assert_predicate writer, :binmode? + assert_predicate writer0, :binmode? assert_predicate writer2, :binmode? - assert_equal writer.binmode?, writer2.binmode? - assert_equal writer.external_encoding, writer2.external_encoding - assert_equal writer.internal_encoding, writer2.internal_encoding - assert_predicate reader, :binmode? + assert_equal writer0.binmode?, writer2.binmode? + assert_equal writer0.external_encoding, writer2.external_encoding + assert_equal writer0.internal_encoding, writer2.internal_encoding + assert_predicate reader0, :binmode? assert_predicate reader2, :binmode? - assert_equal reader.binmode?, reader2.binmode? - assert_equal reader.external_encoding, reader2.external_encoding - assert_equal reader.internal_encoding, reader2.internal_encoding + assert_equal reader0.binmode?, reader2.binmode? + assert_equal reader0.external_encoding, reader2.external_encoding + assert_equal reader0.internal_encoding, reader2.internal_encoding reader3, writer3 = IO.pipe("UTF-8:UTF-8", binmode: true) assert_predicate writer3, :binmode? @@ -159,18 +159,14 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L159 assert_equal reader1.external_encoding, reader5.external_encoding assert_equal reader1.internal_encoding, reader5.internal_encoding ensure - reader.close if reader - writer.close if writer - reader1.close if reader1 - writer1.close if writer1 - reader2.close if reader2 - writer2.close if writer2 - reader3.close if reader3 - writer3.close if writer3 - reader4.close if reader4 - writer4.close if writer4 - reader5.close if reader5 - writer5.close if writer5 + [ + reader0, writer0, + reader1, writer1, + reader2, writer2, + reader3, writer3, + reader4, writer4, + reader5, writer5, + ].compact.map(&:close) end end end -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/