summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorskandhas <[email protected]>2012-11-30 22:31:35 +0800
committerskandhas <[email protected]>2012-11-30 22:31:35 +0800
commita100352595794ec1f1a1aaa5ae1654bc29d21192 (patch)
tree85cf2066e0784d6e3c6118fd4d3eb5f283d2336c /test
parent9704ceefcee91b4dbb71e559b507936c002489cf (diff)
downloadmruby-a100352595794ec1f1a1aaa5ae1654bc29d21192.tar.gz
mruby-a100352595794ec1f1a1aaa5ae1654bc29d21192.zip
add test for 'Abbreviated variable assignment as returns'
Diffstat (limited to 'test')
-rw-r--r--test/t/syntax.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/t/syntax.rb b/test/t/syntax.rb
index 47221d425..0501608e5 100644
--- a/test/t/syntax.rb
+++ b/test/t/syntax.rb
@@ -58,3 +58,14 @@ assert('Nested const reference') do
Syntax4Const::CONST1 == "hello world" and
Syntax4Const::Const2.new.const1 == "hello world"
end
+
+assert('Abbreviated variable assignment as returns') do
+ module Syntax4AbbrVarAsgnAsReturns
+ class A
+ def b
+ @c ||= 1
+ end
+ end
+ end
+ Syntax4AbbrVarAsgnAsReturns::A.new.b == 1
+end