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

ruby-changes:41031

From: hsbt <ko1@a...>
Date: Mon, 14 Dec 2015 17:04:43 +0900 (JST)
Subject: [ruby-changes:41031] hsbt:r53110 (trunk): * bootstraptest/runner.rb: use safe navigation operator.

hsbt	2015-12-14 17:04:28 +0900 (Mon, 14 Dec 2015)

  New Revision: 53110

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

  Log:
    * bootstraptest/runner.rb: use safe navigation operator.
      [fix GH-1142] Patch by @mlarraz
    * test/openssl/test_pair.rb: ditto.
    * test/ruby/test_econv.rb: ditto.
    * test/ruby/test_settracefunc.rb: ditto.
    * test/thread/test_queue.rb: ditto.

  Modified files:
    trunk/ChangeLog
    trunk/bootstraptest/runner.rb
    trunk/test/openssl/test_pair.rb
    trunk/test/ruby/test_econv.rb
    trunk/test/ruby/test_settracefunc.rb
    trunk/test/thread/test_queue.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 53109)
+++ ChangeLog	(revision 53110)
@@ -1,3 +1,12 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Dec 14 17:03:05 2015  SHIBATA Hiroshi  <hsbt@r...>
+
+	* bootstraptest/runner.rb: use safe navigation operator.
+	  [fix GH-1142] Patch by @mlarraz
+	* test/openssl/test_pair.rb: ditto.
+	* test/ruby/test_econv.rb: ditto.
+	* test/ruby/test_settracefunc.rb: ditto.
+	* test/thread/test_queue.rb: ditto.
+
 Mon Dec 14 14:33:35 2015  SHIBATA Hiroshi  <hsbt@r...>
 
 	* lib/xmlrpc.rb: added documentation for parser details.
Index: bootstraptest/runner.rb
===================================================================
--- bootstraptest/runner.rb	(revision 53109)
+++ bootstraptest/runner.rb	(revision 53110)
@@ -347,7 +347,7 @@ def assert_normal_exit(testsrc, *rest) https://github.com/ruby/ruby/blob/trunk/bootstraptest/runner.rb#L347
       $stderr.reopen(old_stderr)
       old_stderr.close
     end
-    if status && status.signaled?
+    if status&.signaled?
       signo = status.termsig
       signame = Signal.list.invert[signo]
       unless ignore_signals and ignore_signals.include?(signame)
Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 53109)
+++ test/ruby/test_settracefunc.rb	(revision 53110)
@@ -464,7 +464,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L464
     EOF
     self.class.class_eval{remove_const(:XYZZY)}
     ensure
-      trace.disable if trace && trace.enabled?
+      trace.disable if trace&.enabled?
     end
 
     answer_events = [
Index: test/ruby/test_econv.rb
===================================================================
--- test/ruby/test_econv.rb	(revision 53109)
+++ test/ruby/test_econv.rb	(revision 53110)
@@ -18,8 +18,8 @@ class TestEncodingConverter < Test::Unit https://github.com/ruby/ruby/blob/trunk/test/ruby/test_econv.rb#L18
 
   def assert_errinfo(e_res, e_enc1, e_enc2, e_error_bytes, e_readagain_bytes, ec)
     assert_equal([e_res, e_enc1, e_enc2,
-                  e_error_bytes && e_error_bytes.b,
-                  e_readagain_bytes && e_readagain_bytes.b],
+                  e_error_bytes&.b,
+                  e_readagain_bytes&.b],
                  ec.primitive_errinfo)
   end
 
Index: test/thread/test_queue.rb
===================================================================
--- test/thread/test_queue.rb	(revision 53109)
+++ test/thread/test_queue.rb	(revision 53110)
@@ -427,7 +427,7 @@ class TestQueue < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/thread/test_queue.rb#L427
 
       # wait for all threads to be finished, because of exceptions
       # NOTE: thr.status will be nil (raised) or false (terminated)
-      sleep 0.01 until prod_threads && prod_threads.all?{|thr| !thr.status}
+      sleep 0.01 until prod_threads&.all?{|thr| !thr.status}
 
       # check that all threads failed to call push
       prod_threads.each do |thr|
Index: test/openssl/test_pair.rb
===================================================================
--- test/openssl/test_pair.rb	(revision 53109)
+++ test/openssl/test_pair.rb	(revision 53110)
@@ -49,7 +49,7 @@ module OpenSSL::SSLPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L49
       return c, s
     end
   ensure
-    if th && th.alive?
+    if th&.alive?
       th.kill
       th.join
     end

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

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