From 93e36dd664a9d3f95456769ca2d29c48503bd0e7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 10 Dec 2010 17:56:14 -0800 Subject: add a new TDB::HashFunctions module It's nice to have common hash functions available... --- test/test_tdb_hash_functions.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/test_tdb_hash_functions.rb (limited to 'test') diff --git a/test/test_tdb_hash_functions.rb b/test/test_tdb_hash_functions.rb new file mode 100644 index 0000000..86c599a --- /dev/null +++ b/test/test_tdb_hash_functions.rb @@ -0,0 +1,15 @@ +# -*- encoding: binary -*- +require 'test/unit' +$-w = true +require 'tdb' + +class TestHashFunctions < Test::Unit::TestCase + include TDB::HashFunctions + + def test_hashes + TDB::HASHES.each do |name,_| + next if :default == name + assert_kind_of Integer, __send__("tdb_hash_#{name}", "hello") + end + end +end -- cgit v1.2.3-24-ge0c7