Merged with master and am ready to merge back
[dbsrgits/DBM-Deep.git] / t / 29_largedata.t
index 70d67fa..28dcd5a 100644 (file)
@@ -1,27 +1,25 @@
-##
-# DBM::Deep Test
-##
 use strict;
-use Test::More tests => 4;
-use t::common qw( new_fh );
+use warnings FATAL => 'all';
+
+use Test::More;
+use t::common qw( new_dbm );
 
 use_ok( 'DBM::Deep' );
 
-my ($fh, $filename) = new_fh();
-my $db = DBM::Deep->new(
-       file => $filename,
-);
+my $dbm_factory = new_dbm();
+while ( my $dbm_maker = $dbm_factory->() ) {
+    my $db = $dbm_maker->();
+
+    my $val1 = "a" x 6000;
 
-##
-# large keys
-##
-my $val1 = "a" x 1000;
+    $db->{foo} = $val1;
+    is( $db->{foo}, $val1, "6000 char value stored and retrieved" );
 
-$db->{foo} = $val1;
-is( $db->{foo}, $val1, "1000 char value stored and retrieved" );
+#    delete $db->{foo};
+#    my $size = -s $filename;
+#    $db->{bar} = "a" x 300;
+#    is( $db->{bar}, 'a' x 300, "New 256 char value is stored" );
+#    cmp_ok( $size, '==', -s $filename, "Freespace is reused" );
+}
 
-delete $db->{foo};
-my $size = -s $filename;
-$db->{bar} = "a" x 300;
-is( $db->{bar}, 'a' x 300, "New 256 char value is stored" );
-cmp_ok( $size, '==', -s $filename, "Freespace is reused" );
+done_testing;