Use &. after &.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-09-08 02:44:24 +00:00
parent edc4df3282
commit 7671126dfb

View File

@ -188,8 +188,8 @@ class TestThread < Test::Unit::TestCase
end end
ensure ensure
t1&.kill.join t1&.kill&.join
t2&.kill.join t2&.kill&.join
end end
def test_new_symbol_proc def test_new_symbol_proc
@ -205,7 +205,7 @@ class TestThread < Test::Unit::TestCase
assert_nil(t.join(0.05)) assert_nil(t.join(0.05))
ensure ensure
t&.kill.join t&.kill&.join
end end
def test_join2 def test_join2
@ -312,7 +312,7 @@ class TestThread < Test::Unit::TestCase
assert_equal(2, s) assert_equal(2, s)
assert_raise(ThreadError) { t.wakeup } assert_raise(ThreadError) { t.wakeup }
ensure ensure
t&.kill.join t&.kill&.join
end end
def test_stop def test_stop
@ -511,7 +511,7 @@ class TestThread < Test::Unit::TestCase
assert_equal(["run", false], [es1, es2]) assert_equal(["run", false], [es1, es2])
assert_raise(RuntimeError) { a.join } assert_raise(RuntimeError) { a.join }
ensure ensure
b&.kill.join b&.kill&.join
c&.join c&.join
end end
@ -530,7 +530,7 @@ class TestThread < Test::Unit::TestCase
end end
assert(!flag, bug1402) assert(!flag, bug1402)
ensure ensure
waiter.kill.join waiter&.kill&.join
end end
def test_safe_level def test_safe_level
@ -547,7 +547,7 @@ class TestThread < Test::Unit::TestCase
assert_equal($SAFE, t.safe_level) assert_equal($SAFE, t.safe_level)
ensure ensure
$SAFE = 0 $SAFE = 0
t&.kill.join t&.kill&.join
end end
def test_thread_local def test_thread_local
@ -567,7 +567,7 @@ class TestThread < Test::Unit::TestCase
assert_equal([:foo, :bar, :baz].sort, t.keys.sort) assert_equal([:foo, :bar, :baz].sort, t.keys.sort)
ensure ensure
t&.kill.join t&.kill&.join
end end
def test_thread_local_fetch def test_thread_local_fetch
@ -599,7 +599,7 @@ class TestThread < Test::Unit::TestCase
assert_equal(:qux, e.key) assert_equal(:qux, e.key)
assert_equal(t, e.receiver) assert_equal(t, e.receiver)
ensure ensure
t&.kill.join t&.kill&.join
end end
def test_thread_local_security def test_thread_local_security