diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-01 22:46:32 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-01 22:46:32 +0000 |
commit | f810d1804a7e1c2dbdb2d4d6c0406674a1912ea3 (patch) | |
tree | 42fa784f7c89431e8e563cf48495d06c52f40e26 /test | |
parent | 83610815d4ec34b3d5528aa8dbc6c4a475c7ed92 (diff) | |
download | ruby-f810d1804a7e1c2dbdb2d4d6c0406674a1912ea3.tar.gz |
* proc.c (proc_curry): Fix arity check [Bug #5747]
* test/ruby/test_proc.rb: Test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_proc.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index ca716a696c..dc426ddda5 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -270,6 +270,13 @@ class TestProc < Test::Unit::TestCase assert_equal(self, result[1]) end + def test_curry_optional_params + obj = Object.new + def obj.foo(a, b=42); end + assert_raise(ArgumentError) { obj.method(:foo).to_proc.curry(3) } + assert_raise(ArgumentError) { ->(a, b=42){}.curry(3) } + end + def test_dup_clone b = proc {|x| x + "bar" } class << b; attr_accessor :foo; end |