diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 11:43:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-02 11:43:36 +0000 |
commit | 548698397a99065717fdc7766eaabf6af7a4026e (patch) | |
tree | 3d54421250ef7211b58fa778481196573653c6e2 | |
parent | 896e7f2d8dd7fa190c4514043b3aa5fcfa20c65f (diff) | |
download | ruby-548698397a99065717fdc7766eaabf6af7a4026e.tar.gz |
test_call.rb: refine test_safe_call
* test/ruby/test_call.rb (test_safe_call): rhs should not be
evaluated when the receiver is nil. simplified the assertion
for [Bug #13964].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/ruby/test_call.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb index 18203ce731..2a1b671cac 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -50,9 +50,9 @@ class TestCall < Test::Unit::TestCase o = nil assert_nil(o&.x) - assert_nothing_raised(NoMethodError) {o&.x = 6} - assert_nothing_raised(NoMethodError) {o&.x *= 7} - assert_nothing_raised(NoMethodError) {o&.x *= 8; [].each {}} + assert_nothing_raised(NoMethodError) {o&.x = raise} + assert_nothing_raised(NoMethodError) {o&.x *= raise} + assert_nothing_raised(NoMethodError) {o&.x *= raise; nil} end def test_safe_call_evaluate_arguments_only_method_call_is_made |