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

ruby-changes:59225

From: Nobuyoshi <ko1@a...>
Date: Fri, 13 Dec 2019 08:52:27 +0900 (JST)
Subject: [ruby-changes:59225] b8d6c883b3 (master): Improved the test for Thread#inspect [Feature #16412]

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

From b8d6c883b3f49e6339da4fa5111dbdbe7d3c6df5 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 13 Dec 2019 08:52:07 +0900
Subject: Improved the test for Thread#inspect [Feature #16412]


diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 9d62059..bf61a28 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -29,8 +29,12 @@ class TestThread < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L29
   end
 
   def test_inspect
+    line = __LINE__+1
     th = Module.new {break module_eval("class C\u{30b9 30ec 30c3 30c9} < Thread; self; end")}.start{}
-    assert_match(/::C\u{30b9 30ec 30c3 30c9}:/, th.inspect)
+    s = th.inspect
+    assert_include(s, "::C\u{30b9 30ec 30c3 30c9}:")
+    assert_include(s, " #{__FILE__}:#{line} ")
+    assert_equal(s, th.to_s)
   ensure
     th.join
   end
-- 
cgit v0.10.2


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

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