summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-24 02:45:07 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-24 02:45:07 +0000
commit1a3bca1dd6c43d4b6ec638d9b0987c0488af6fae (patch)
tree9c7437ded4b6e1e73d23178828035f78ea9e896c /test/ruby
parentdb22ab157503ac1417a3d63aaaf6bbe159decea7 (diff)
merge revision(s) 60099,60100: [Backport #13964]
compile.c: fix stack consitency error * compile.c (iseq_compile_each0): fix stack consitency error on attr-assign with safe navigation operator when the receiver is nil, should pop it too. [ruby-core:83078] [Bug #13964] 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/branches/ruby_2_4@61439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_call.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb
index 4496d78210..2a1b671cac 100644
--- a/test/ruby/test_call.rb
+++ b/test/ruby/test_call.rb
@@ -50,8 +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 = 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