diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 21:36:19 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-25 21:36:19 +0000 |
commit | 64f0682d7da858cf49c5559513a838248f8efee5 (patch) | |
tree | 2b7f166ad0ee8d54247fc34879a8e451ac4e376a /test/ruby | |
parent | 43c3f447a4d442e0b135220013c89f3742645b37 (diff) | |
download | ruby-64f0682d7da858cf49c5559513a838248f8efee5.tar.gz |
* proc.c: Having any mandatory keyword argument increases min arity [#9299]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_proc.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index 6c92f1e374..1c8a053cca 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -85,6 +85,11 @@ class TestProc < Test::Unit::TestCase assert_equal(2, proc{|x, y=0, z, **o|}.arity) assert_equal(-3, proc{|x, y=0, *z, w, **o|}.arity) + assert_equal(2, proc{|x, y=0, z, a:1|}.arity) + assert_equal(3, proc{|x, y=0, z, a:|}.arity) + assert_equal(-4, proc{|x, y, *rest, a:, b:, c:|}.arity) + assert_equal(3, proc{|x, y=0, z, a:, **o|}.arity) + assert_equal(0, lambda{}.arity) assert_equal(0, lambda{||}.arity) assert_equal(1, lambda{|x|}.arity) |