Initial migration from dev.iinteractive.com
[dbsrgits/DBM-Deep.git] / t / 03bighash.t
diff --git a/t/03bighash.t b/t/03bighash.t
new file mode 100644 (file)
index 0000000..0fbe30d
--- /dev/null
@@ -0,0 +1,30 @@
+##
+# DBM::Deep Test
+##
+use strict;
+use Test::More;
+
+my $max_keys = 4000;
+plan tests => 2 + $max_keys;
+
+use_ok( 'DBM::Deep' );
+
+unlink "t/test.db";
+my $db = DBM::Deep->new(
+       file => "t/test.db",
+       type => DBM::Deep->TYPE_HASH
+);
+if ($db->error()) {
+       die "ERROR: " . $db->error();
+}
+
+##
+# put/get many keys
+##
+for ( 0 .. $max_keys ) {
+    $db->put( "hello $_" => "there " . $_ * 2 );
+}
+
+for ( 0 .. $max_keys ) {
+    is( $db->get( "hello $_" ), "there " . $_ * 2, "The ${_}th value is correct" );
+}