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

ruby-changes:59951

From: Nobuyoshi <ko1@a...>
Date: Fri, 7 Feb 2020 13:55:28 +0900 (JST)
Subject: [ruby-changes:59951] 6ed1a5e0e6 (master): Made a test more robust

https://git.ruby-lang.org/ruby.git/commit/?id=6ed1a5e0e6

From 6ed1a5e0e62bbdadcf3d0c61fcfe0c5f8d01789b Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 7 Feb 2020 13:50:20 +0900
Subject: Made a test more robust

Against changes of the `assert_separately` prologue code.

diff --git a/test/ruby/test_module.rb b/test/ruby/test_module.rb
index 2e0a14e..5194a56 100644
--- a/test/ruby/test_module.rb
+++ b/test/ruby/test_module.rb
@@ -2393,7 +2393,10 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L2393
 
   def test_inspect_segfault
     bug_10282 = '[ruby-core:65214] [Bug #10282]'
-    assert_separately [], <<-RUBY
+    assert_separately [], "#{<<~"begin;"}\n#{<<~'end;'}"
+    bug_10282 = "#{bug_10282}"
+    begin;
+      line = __LINE__ + 2
       module ShallowInspect
         def shallow_inspect
           "foo"
@@ -2410,9 +2413,9 @@ class TestModule < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_module.rb#L2413
 
       A.prepend InspectIsShallow
 
-      expect = "#<Method: A(ShallowInspect)#inspect(shallow_inspect)() -:7>"
-      assert_equal expect, A.new.method(:inspect).inspect, "#{bug_10282}"
-    RUBY
+      expect = "#<Method: A(ShallowInspect)#inspect(shallow_inspect)() -:#{line}>"
+      assert_equal expect, A.new.method(:inspect).inspect, bug_10282
+    end;
   end
 
   def test_define_method_with_unbound_method
-- 
cgit v0.10.2


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

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