X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F03bighash.t;fp=t%2F03bighash.t;h=0fbe30d04c4529fb3f267f617861cdfbfd617665;hb=ffed8b01eb6e0d22e36c84491a96067b54ac7087;hp=0000000000000000000000000000000000000000;hpb=6201de1c4443569f9be99ad7026b92e4b3d6730a;p=dbsrgits%2FDBM-Deep.git diff --git a/t/03bighash.t b/t/03bighash.t new file mode 100644 index 0000000..0fbe30d --- /dev/null +++ b/t/03bighash.t @@ -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" ); +}