diff options
author | wanabe <s.wanabe@gmail.com> | 2020-08-08 08:37:52 +0900 |
---|---|---|
committer | wanabe <s.wanabe@gmail.com> | 2020-10-16 08:37:04 +0900 |
commit | ce7a053475cbebfb2f3e5ed6614e0ba631541917 (patch) | |
tree | b72b49eb34ca341c2cff023f205d80379e62c3a4 /test/ruby/test_syntax.rb | |
parent | b68c22b3c6a80ebf96d446348bc8007b8a10f694 (diff) |
Adjust sp for `x = false; y = (return until x unless x)` [Bug #16695]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3445
Diffstat (limited to 'test/ruby/test_syntax.rb')
-rw-r--r-- | test/ruby/test_syntax.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 0542d4f90d..ac2a0da9cd 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1388,6 +1388,15 @@ eom assert_nil obj.test end + def test_assignment_return_in_loop + obj = Object.new + def obj.test + x = nil + y = (return until x unless x) + end + assert_nil obj.test, "[Bug #16695]" + end + def test_method_call_location line = __LINE__+5 e = assert_raise(NoMethodError) do |