diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-18 10:09:43 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-18 10:09:43 +0000 |
commit | c223709c3b95127e7a0c0b3812ea2e89ecb8646f (patch) | |
tree | c369c5bd6e958163f739edc0493f5b6fd0e25a05 /test | |
parent | 311fdfdfeaceb581c51602f5aeeff40c12567a78 (diff) |
* eval.c (proc_eq): avoid false positive by using scope and
dyna_vars. no longer use frame.uniq.
* eval.c (proc_arity): arity is now defined as number of
parameters that would not be ignored. i.e. Proc.new{}.arity
returns zero. update test suites too.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_iterator.rb | 4 | ||||
-rw-r--r-- | test/ruby/test_proc.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/ruby/test_iterator.rb b/test/ruby/test_iterator.rb index 38e795ee72..1c293069c4 100644 --- a/test/ruby/test_iterator.rb +++ b/test/ruby/test_iterator.rb @@ -311,8 +311,8 @@ class TestIterator < Test::Unit::TestCase block = get_block{11} lambda = lambda{44} - assert_equal(-1, block.arity) - assert_equal(-1, lambda.arity) + assert_equal(0, block.arity) + assert_equal(0, lambda.arity) assert_equal(0, lambda{||}.arity) assert_equal(1, lambda{|a|}.arity) assert_equal(1, lambda{|a,|}.arity) diff --git a/test/ruby/test_proc.rb b/test/ruby/test_proc.rb index f0b78ffb23..8d8b17e0d7 100644 --- a/test/ruby/test_proc.rb +++ b/test/ruby/test_proc.rb @@ -50,7 +50,7 @@ class TestProc < Test::Unit::TestCase end def test_arity - assert_equal(-1, proc{}.arity) + assert_equal(0, proc{}.arity) assert_equal(0, proc{||}.arity) assert_equal(1, proc{|x|}.arity) assert_equal(2, proc{|x, y|}.arity) @@ -58,7 +58,7 @@ class TestProc < Test::Unit::TestCase assert_equal(-1, proc{|*x|}.arity) assert_equal(-1, proc{|*|}.arity) - assert_arity(-1) {} + assert_arity(0) {} assert_arity(0) {||} assert_arity(1) {|x|} assert_arity(2) {|x, y|} |