diff options
| author | Uchio KONDO <[email protected]> | 2018-10-11 17:40:18 +0900 |
|---|---|---|
| committer | Uchio KONDO <[email protected]> | 2018-10-15 14:46:24 +0900 |
| commit | 7c527342436308469041406aa558c0ac1e47a9fe (patch) | |
| tree | c94dc992e28d8eb89eb9595f3997a95f7499bec0 /test | |
| parent | fdd5ce8fac8f306f71f336f07f0a537b8626e6d6 (diff) | |
| download | mruby-7c527342436308469041406aa558c0ac1e47a9fe.tar.gz mruby-7c527342436308469041406aa558c0ac1e47a9fe.zip | |
Add a testcase of #4137 fix
Diffstat (limited to 'test')
| -rw-r--r-- | test/t/syntax.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/t/syntax.rb b/test/t/syntax.rb index 883cbd1ba..a726719f8 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -187,6 +187,18 @@ assert('Abbreviated variable assignment as returns') do assert_equal 1, Syntax4AbbrVarAsgnAsReturns::A.new.b 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 *a = *[1,2,3] b, *c = *[7,8,9] |
