Project

General

Profile

Bug #675

Failure: test_delete_with_block(TestSDBM)

Added by znz (Kazuhiro NISHIYAMA) about 11 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
Backport:
[ruby-dev:36855]

Description

=begin
1) Failure:
test_delete_with_block(TestSDBM) [.../trunk/test/sdbm/test_sdbm.rb:375]:
<"called block"> expected but was
<"no called block">.
も調べてみました。

ext/sdbm/init.cのfsdbm_deleteで
ExportStringValue(keystr);
で別のオブジェクトになる可能性があるkeystrを
if (rb_block_given_p()) return rb_yield(keystr);
でrb_yieldに渡しているのにテストの方で
key = 'no called block'
assert_equal(:blockval,
@sdbm.delete(key) {|k| k.replace 'called block'; :blockval})
assert_equal('called block', key)
のように同じオブジェクトが来ると仮定してString#replaceを呼んでいるからのようです。
=end

History

#1

Updated by matz (Yukihiro Matsumoto) about 11 years ago

  • Status changed from Open to Closed

=begin
closed by r19885.
=end

Also available in: Atom PDF