diff options
Diffstat (limited to 'test')
-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 3e77f44efe..ab462bddf4 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -1265,6 +1265,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 |