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

ruby-changes:50302

From: nobu <ko1@a...>
Date: Fri, 16 Feb 2018 09:54:55 +0900 (JST)
Subject: [ruby-changes:50302] nobu:r62417 (trunk): test_rubyoptions.rb: assert_same to check identity

nobu	2018-02-16 09:54:50 +0900 (Fri, 16 Feb 2018)

  New Revision: 62417

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

  Log:
    test_rubyoptions.rb: assert_same to check identity

  Modified files:
    trunk/test/ruby/test_optimization.rb
Index: test/ruby/test_optimization.rb
===================================================================
--- test/ruby/test_optimization.rb	(revision 62416)
+++ test/ruby/test_optimization.rb	(revision 62417)
@@ -571,14 +571,14 @@ class TestRubyOptimization < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/ruby/test_optimization.rb#L571
   def test_peephole_dstr
     code = "#{<<~'begin;'}\n#{<<~'end;'}"
     begin;
-      exp = (-'a').object_id
+      exp = -'a'
       z = 'a'
-      exp == (-"#{z}").object_id
+      [exp, -"#{z}"]
     end;
     [ false, true ].each do |fsl|
       iseq = RubyVM::InstructionSequence.compile(code,
                                                  frozen_string_literal: fsl)
-      assert_equal(true, iseq.eval,
+      assert_same(*iseq.eval,
                   "[ruby-core:85542] [Bug #14475] fsl: #{fsl}")
     end
   end

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

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