summaryrefslogtreecommitdiff
path: root/test/dbm
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 22:07:05 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 22:07:05 +0000
commitc82769f2277a8b06ea6a104ab4e7e7c8043d658a (patch)
tree8507f1c371bc65d90da52feb0bb437e0719e0356 /test/dbm
parent80d16e7403e64c5ba19b83046b3530aeaf4ed62b (diff)
* ext/dbm/dbm.c (fdbm_index): make #index warn like Hash.
* ext/dbm/dbm.c (fdbm_key): new method. * ext/sdbm/init.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dbm')
-rw-r--r--test/dbm/test_dbm.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index 546e969..5cf8acb 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -160,9 +160,9 @@ if defined? DBM
}
end
- def test_index
+ def test_key
assert_equal('bar', @dbm['foo'] = 'bar')
- assert_equal('foo', @dbm.index('bar'))
+ assert_equal('foo', @dbm.key('bar'))
assert_nil(@dbm['bar'])
end
@@ -217,7 +217,7 @@ if defined? DBM
n = 0
ret = @dbm.each_pair {|key, val|
- assert_not_nil(i = keys.index(key))
+ assert_not_nil(i = keys.key(key))
assert_equal(val, values[i])
n += 1
@@ -238,8 +238,8 @@ if defined? DBM
n = 0
ret = @dbm.each_value {|val|
- assert_not_nil(key = @dbm.index(val))
- assert_not_nil(i = keys.index(key))
+ assert_not_nil(key = @dbm.key(val))
+ assert_not_nil(i = keys.key(key))
assert_equal(val, values[i])
n += 1
@@ -260,7 +260,7 @@ if defined? DBM
n = 0
ret = @dbm.each_key {|key|
- assert_not_nil(i = keys.index(key))
+ assert_not_nil(i = keys.key(key))
assert_equal(@dbm[key], values[i])
n += 1