test/test_btree.rb in bdb1-0.2.4 vs test/test_btree.rb in bdb1-0.2.5

- old
+ new

@@ -249,11 +249,11 @@ intern_btree_delete end def test_04_btree sub_btree_delete_2 - sub_index + sub_key sub_convert sub_sh sub_sh_call sub_create end @@ -266,16 +266,20 @@ "set_cachesize" => 32 * 1024), "<open>") intern_btree_delete end - def sub_index + def sub_key lines = @hash.keys array = [] 10.times do h = lines[rand(lines.size - 1)] array.push h - assert_equal(@hash.index(h.reverse), @bdb.index(h.reverse), "<index>") + if @hash.respond_to?(:key) + assert_equal(@hash.key(h.reverse), @bdb.key(h.reverse), "<key>") + else + assert_equal(@hash.index(h.reverse), @bdb.index(h.reverse), "<index>") + end end assert_equal(@hash.values_at(array), @bdb.values_at(array), "<values_at>") end def sub_convert