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

ruby-changes:67241

From: Jeremy <ko1@a...>
Date: Wed, 25 Aug 2021 00:36:28 +0900 (JST)
Subject: [ruby-changes:67241] 14a9c364f7 (master): Fix warnings in test_optimization.rb

https://git.ruby-lang.org/ruby.git/commit/?id=14a9c364f7

From 14a9c364f75a9729d5a49e1fbea08fec2f813bdd Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Tue, 24 Aug 2021 08:34:48 -0700
Subject: Fix warnings in test_optimization.rb

These were introduced in the test for tracing optimized methods
added in 48c8df9e0eb295af06d593ce37ce1933c0ee1d90.
---
 test/ruby/test_optimization.rb | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/test/ruby/test_optimization.rb b/test/ruby/test_optimization.rb
index 226fb44..2075bf3 100644
--- a/test/ruby/test_optimization.rb
+++ b/test/ruby/test_optimization.rb
@@ -158,7 +158,7 @@ class TestRubyOptimization < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L158
       methods = []
       tp = TracePoint.new(type) { |tp| methods << tp.method_id }
       tp.enable do
-        x = "a"; -x
+        x = "a"; x = -x
         [1].max
         [1].min
         x = 42 + 2
@@ -166,11 +166,11 @@ class TestRubyOptimization < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L166
         x = 42 * 2
         x = 42 / 2
         x = 42 % 2
-        x == 42
-        x < 42
-        x <= 42
-        x > 42
-        x >= 42
+        y = x == 42
+        y = x < 42
+        y = x <= 42
+        y = x > 42
+        y = x >= 42
         x = x << 1
         x = x & 1
         x = x | 1
@@ -182,6 +182,7 @@ class TestRubyOptimization < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L182
         x = 1; x.succ
         !x
         x = 'a'; x =~ /a/
+        x = y
       end
       assert_equal(expected, methods, bug14870)
     end
-- 
cgit v1.1


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

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