Merge pull request #2143 from mirichi/test

add post mandatory argument test
This commit is contained in:
Yukihiro "Matz" Matsumoto
2014-04-28 10:44:31 +09:00
+25
View File
@@ -487,3 +487,28 @@ assert("BS Block 35") do
end
assert_equal :ok, TestReturnFromNestedBlock_BSBlock35.test
end
assert('BS Block 36') do
def iter
yield 1, 2, 3, 4, 5
end
assert_equal([1, 2, [3, 4], 5]) do
iter{|a, b, *c, d|
[a, b, c, d]
}
end
end
assert('BS Block 37') do
def iter
yield 1, 2, 3
end
assert_equal([1, 2, [], 3]) do
iter{|a, b, *c, d|
[a, b, c, d]
}
end
end