diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | test/dbm/test_dbm.rb | 15 |
2 files changed, 19 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Sat Feb 18 13:40:37 2012 Tanaka Akira <akr@fsij.org> + + * test/dbm/test_dbm.rb (test_dbmfile_suffix): test dbm file suffix. + Sat Feb 18 12:50:59 2012 Tanaka Akira <akr@fsij.org> * ext/dbm/dbm.c (DBM::VERSION): define it by detecting _GDBM_H_ or diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb index 79c8ae2150..582b0d7eaf 100644 --- a/test/dbm/test_dbm.rb +++ b/test/dbm/test_dbm.rb @@ -96,6 +96,21 @@ if defined? DBM end end + def test_dbmfile_suffix + prefix = File.basename(@path) + files = Dir.entries(@tmpdir).reject {|f| !f.start_with?(prefix) }.sort + case DBM::VERSION + when /\bNDBM\b/ + assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files) + when /\bGDBM\b/ + assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files) + when /\bBerkeley DB\b/ + assert_equal(["#{prefix}.db"], files) + when /\bQDBM\b/ + assert_equal(["#{prefix}.dir", "#{prefix}.pag"], files) + end + end + def test_s_new_has_no_block # DBM.new ignore the block foo = true |