1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash.

[ruby-dev:37039]

* ext/sdbm/init.c (Init_sdbm): typo fixed.  [ruby-dev:37039]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-11-08 03:15:28 +00:00
parent 0042ccef2c
commit 703fb3d9be
5 changed files with 25 additions and 9 deletions

View file

@ -276,9 +276,9 @@ if defined? GDBM
}
end
def test_index
def test_key
assert_equal('bar', @gdbm['foo'] = 'bar')
assert_equal('foo', @gdbm.index('bar'))
assert_equal('foo', @gdbm.key('bar'))
assert_nil(@gdbm['bar'])
end
@ -354,7 +354,7 @@ if defined? GDBM
n = 0
ret = @gdbm.each_value {|val|
assert_not_nil(key = @gdbm.index(val))
assert_not_nil(key = @gdbm.key(val))
assert_not_nil(i = keys.index(key))
assert_equal(val, values[i])