diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-13 08:52:07 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-12-13 08:52:07 +0900 |
commit | b8d6c883b3f49e6339da4fa5111dbdbe7d3c6df5 (patch) | |
tree | c9de2e9af01b8a32c89ff3a6a0e499af48cb6ed6 /test | |
parent | fa5f7a8f7ef0d03b8ac97d25a0460c0dc6bb33f3 (diff) |
Improved the test for Thread#inspect [Feature #16412]
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_thread.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 9d6205979b..bf61a28f4d 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -29,8 +29,12 @@ class TestThread < Test::Unit::TestCase 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 |