summaryrefslogtreecommitdiffhomepage
path: root/test/t/syntax.rb
diff options
context:
space:
mode:
authorPaolo Bosetti <[email protected]>2012-08-06 15:02:03 +0200
committerPaolo Bosetti <[email protected]>2012-08-06 15:02:56 +0200
commitaa0d2f91447c49363059f2e95cb9023f65a6fbef (patch)
tree2cfa325956e62648f2161564adfdf6dddc45b737 /test/t/syntax.rb
parentfd097b8aff7b91bd105fc1daec5a4050a947b763 (diff)
parent193c98ae540d43d082795fd77ea81a4f6f7fd0f6 (diff)
downloadmruby-aa0d2f91447c49363059f2e95cb9023f65a6fbef.tar.gz
mruby-aa0d2f91447c49363059f2e95cb9023f65a6fbef.zip
Updated Xcode project build settings in conformity with 10.8/Xcode 4.4
Diffstat (limited to 'test/t/syntax.rb')
-rw-r--r--test/t/syntax.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/t/syntax.rb b/test/t/syntax.rb
new file mode 100644
index 000000000..7898a0b7d
--- /dev/null
+++ b/test/t/syntax.rb
@@ -0,0 +1,47 @@
+assert('super', '11.3.4') do
+ test = false
+ begin
+ super
+ rescue NoMethodError
+ test = true
+ end
+
+ class SuperFoo
+ def foo
+ true
+ end
+ def bar(*a)
+ a
+ end
+ end
+ class SuperBar < SuperFoo
+ def foo
+ super
+ end
+ def bar(*a)
+ super(*a)
+ end
+ end
+ bar = SuperBar.new
+ test &&= bar.foo
+ test &&= (bar.bar(1,2,3) == [1,2,3])
+ test
+end
+
+assert('yield', '11.3.5') do
+ begin
+ yield
+ rescue LocalJumpError
+ true
+ else
+ false
+ end
+end
+
+assert('Abbreviated variable assignment', '11.4.2.3.2') do
+ a ||= 1
+ b &&= 1
+ c = 1
+ c += 2
+ a == 1 and b == nil and c == 3
+end