From: rkinyon Date: Tue, 5 Dec 2006 01:47:46 +0000 (+0000) Subject: Added the test for large data sections X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5639e32de1c1c61a42bccf1bbc8dde85627c0712;p=dbsrgits%2FDBM-Deep.git Added the test for large data sections --- diff --git a/t/29_largedata.t b/t/29_largedata.t new file mode 100644 index 0000000..70d67fa --- /dev/null +++ b/t/29_largedata.t @@ -0,0 +1,27 @@ +## +# DBM::Deep Test +## +use strict; +use Test::More tests => 4; +use t::common qw( new_fh ); + +use_ok( 'DBM::Deep' ); + +my ($fh, $filename) = new_fh(); +my $db = DBM::Deep->new( + file => $filename, +); + +## +# large keys +## +my $val1 = "a" x 1000; + +$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" );