summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 06:12:36 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-13 06:12:36 +0000
commitb9faaa1832d31bd8d935b3afcadd81a5eb2252ed (patch)
tree6110b0dca6fe50995616b7dc65f1d1de2a333e78 /test
parent4240de3c6dad1e1e2e864ad46b6047fbce0e1859 (diff)
merges r23970 from trunk into ruby_1_9_1.
-- * proc.c (make_curry_proc): should propagate lambda-ness. [ruby-core:24127] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_proc.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb
index 89ae569e34..0b43a03851 100644
--- a/test/ruby/test_proc.rb
+++ b/test/ruby/test_proc.rb
@@ -176,6 +176,18 @@ class TestProc < Test::Unit::TestCase
b = proc { :foo }
assert_equal(:foo, b.curry[])
+
+ b = lambda {|x, y, &b| b.call(x + y) }.curry
+ b = b.call(2) { raise }
+ b = b.call(3) {|x| x + 4 }
+ assert_equal(9, b)
+
+ l = proc {}
+ assert_equal(false, l.lambda?)
+ assert_equal(false, l.curry.lambda?, '[ruby-core:24127]')
+ l = lambda {}
+ assert_equal(true, l.lambda?)
+ assert_equal(true, l.curry.lambda?, '[ruby-core:24127]')
end
def test_curry_ski_fib