Project

General

Profile

Actions

Bug #675

closed

Failure: test_delete_with_block(TestSDBM)

Added by znz (Kazuhiro NISHIYAMA) over 15 years ago. Updated almost 13 years ago.

Status:
Closed
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

Actions #1

Updated by matz (Yukihiro Matsumoto) over 15 years ago

  • Status changed from Open to Closed

=begin
closed by r19885.
=end

Actions

Also available in: Atom PDF

Like0
Like0