Commit 7c527342 authored by Uchio KONDO's avatar Uchio KONDO

Add a testcase of #4137 fix

parent fdd5ce8f
...@@ -187,6 +187,18 @@ assert('Abbreviated variable assignment as returns') do ...@@ -187,6 +187,18 @@ assert('Abbreviated variable assignment as returns') do
assert_equal 1, Syntax4AbbrVarAsgnAsReturns::A.new.b assert_equal 1, Syntax4AbbrVarAsgnAsReturns::A.new.b
end end
assert('Abbreviated variable assignment of object attribute') do
module Syntax4AbbrVarAsgnObjectAttr
class A
attr_accessor :c
def b
self.c ||= 1
end
end
end
assert_equal 1, Syntax4AbbrVarAsgnObjectAttr::A.new.b
end
assert('Splat and multiple assignment') do assert('Splat and multiple assignment') do
*a = *[1,2,3] *a = *[1,2,3]
b, *c = *[7,8,9] b, *c = *[7,8,9]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment