summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-13 17:19:57 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-13 17:19:57 +0000
commit59f8d5d103948dc1628dc220677f0bf2ebe22493 (patch)
tree3c06b6d52b3f4675872d3302acf76306d5486537 /test
parent5a34781bd3ebfa5360d8a1ae8882d80a7f76478a (diff)
merge revision(s) 39877,39881: [Backport #8153] [Backport #8154]
* array.c: Avoid zip bug by not using obsolete rb_check_block_call [Bug #8153] * vm_eval.c (check_funcall_respond_to): preserve passed_block, which is modified in vm_call0_body() via vm_call0(), and caused a bug of rb_check_funcall() by false negative result of rb_block_given_p(). re-fix [ruby-core:53650] [Bug #8153]. [ruby-core:53653] [Bug #8154] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@40281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_array.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb
index 17f2ef66c4..a8b514c830 100644
--- a/test/ruby/test_array.rb
+++ b/test/ruby/test_array.rb
@@ -1918,6 +1918,15 @@ class TestArray < Test::Unit::TestCase
assert_equal([['a', 5], ['b', 6]], %w(a b).zip(ary))
end
+ def test_zip_bug
+ bug8153 = "ruby-core:53650"
+ r = 1..1
+ def r.respond_to?(*)
+ super
+ end
+ assert_equal [[42, 1]], [42].zip(r), bug8153
+ end
+
def test_transpose
assert_equal([[1, :a], [2, :b], [3, :c]],
[[1, 2, 3], [:a, :b, :c]].transpose)