зеркало из https://github.com/github/ruby.git
test_lambda.rb: refine test
* test/ruby/test_lambda.rb (test_lambda_as_iterator): refine a test for the intention of the original report. [ruby-core:61340] [Bug #9605] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
49455d6cdc
Коммит
1de013b3da
|
@ -31,8 +31,10 @@ class TestLambdaParameters < Test::Unit::TestCase
|
|||
bug9605 = '[ruby-core:61468] [Bug #9605]'
|
||||
assert_nothing_raised(ArgumentError, bug9605) {1.times(&->(n){ a += 1 })}
|
||||
assert_equal(3, a, bug9605)
|
||||
assert_nothing_raised(ArgumentError, bug9605) {a = [[1, 2]].map(&->(x, y) {x+y})}
|
||||
assert_equal([3], a, bug9605)
|
||||
assert_nothing_raised(ArgumentError, bug9605) {
|
||||
a = %w(Hi there how are you).each_with_index.detect(&->(w, i) {w.length == 3})
|
||||
}
|
||||
assert_equal(["how", 2], a, bug9605)
|
||||
end
|
||||
|
||||
def test_call_rest_args
|
||||
|
|
Загрузка…
Ссылка в новой задаче