summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-31 16:10:22 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-10-31 16:10:22 +0000
commit8c61368971e229740b6773b91a48932842e7a39d (patch)
tree9aba4cfa8a2e5f6bef3f6f997a133eb7c9849717 /test
parentc26a1e68078583b2a2d80b1d733364deeeae2615 (diff)
* eval.c (rb_call0): fixed bug of zsuper with both of opt and rest.
fixed: [ruby-list:42928] * test/ruby/test_super.rb: add tests to check above bug. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_super.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb
index cf2e241..900fe99 100644
--- a/test/ruby/test_super.rb
+++ b/test/ruby/test_super.rb
@@ -43,6 +43,12 @@ class TestSuper < Test::Unit::TestCase
class Optional3 < Base
def single(a = 1) super end
end
+ class Optional4 < Base
+ def array(a = 1, *) super end
+ end
+ class Optional5 < Base
+ def array(a = 1, b = 2, *) super end
+ end
def test_single1
assert_equal(1, Single1.new.single(1))
@@ -94,6 +100,17 @@ class TestSuper < Test::Unit::TestCase
# call Base#single with 1 argument; the arg is supplied
assert_equal(1, Optional3.new.single)
end
+ def test_optional4
+ assert_equal([1], Optional4.new.array)
+ assert_equal([9], Optional4.new.array(9))
+ assert_equal([9, 8], Optional4.new.array(9, 8))
+ end
+ def test_optional5
+ assert_equal([1, 2], Optional5.new.array)
+ assert_equal([9, 2], Optional5.new.array(9))
+ assert_equal([9, 8], Optional5.new.array(9, 8))
+ assert_equal([9, 8, 7], Optional5.new.array(9, 8, 7))
+ end
class A
def tt(aa)