t/43_transaction_maximum.t
t/44_upgrade_db.t
t/45_references.t
+t/97_dump_file.t
t/98_pod.t
t/99_pod_coverage.t
t/common.pm
);
sub set_filter {
- ##
- # Setup filter function for storing or fetching the key or value
- ##
my $self = shift->_get_self;
my $type = lc shift;
my $func = shift;
Total 97.2 87.4 83.9 100.0 100.0 94.6
----------------------------------- ------ ------ ------ ------ ------ ------
+ ------------------------------------------ ------ ------ ------ ------ ------
+ File stmt bran cond sub total
+ ------------------------------------------ ------ ------ ------ ------ ------
+ blib/lib/DBM/Deep.pm 94.5 85.0 90.5 100.0 93.6
+ blib/lib/DBM/Deep/Array.pm 100.0 94.3 100.0 100.0 98.7
+ blib/lib/DBM/Deep/Engine.pm 95.9 84.9 81.7 100.0 92.8
+ blib/lib/DBM/Deep/File.pm 97.2 81.6 66.7 100.0 91.9
+ blib/lib/DBM/Deep/Hash.pm 100.0 100.0 100.0 100.0 100.0
+ Total 96.5 86.5 83.5 100.0 94.0
+ ------------------------------------------ ------ ------ ------ ------ ------
+
=head1 MORE INFORMATION
Check out the DBM::Deep Google Group at L<http://groups.google.com/group/DBM-Deep>
+++ /dev/null
-use strict;
-use Test::More tests => 1;
-
-use t::common qw( new_fh );
-
-diag "Testing DBM::Deep against Perl $] located at $^X";
-
-use_ok( 'DBM::Deep' );
-
-my ($fh, $filename) = new_fh();
-my $db = DBM::Deep->new(
- file => $filename,
- num_txns => 2,
-);
-
-$db->{foo} = [];
-$db->{bar} = $db->{foo};
-
-warn -s $filename, $/;
-warn $db->_dump_file, $/;
-
-$db->begin_work;
-
- delete $db->{foo};
- delete $db->{bar};
-
- warn -s $filename, $/;
- warn $db->_dump_file, $/;
-
-# XXX Committing seems to break the dumper
-$db->commit;
-#$db->rollback;
-
-warn -s $filename, $/;
-warn $db->_dump_file, $/;
-
-$db->{foo} = 1;
-
-warn -s $filename, $/;
-warn $db->_dump_file, $/;
##
# Now clear all filters, and make sure all is unfiltered
##
-ok( $db->set_filter( 'store_key', undef ), "Unset store_key filter" );
-ok( $db->set_filter( 'store_value', undef ), "Unset store_value filter" );
-ok( $db->set_filter( 'fetch_key', undef ), "Unset fetch_key filter" );
-ok( $db->set_filter( 'fetch_value', undef ), "Unset fetch_value filter" );
+ok( $db->filter_store_key( undef ), "Unset store_key filter" );
+ok( $db->filter_store_value( undef ), "Unset store_value filter" );
+ok( $db->filter_fetch_key( undef ), "Unset fetch_key filter" );
+ok( $db->filter_fetch_value( undef ), "Unset fetch_value filter" );
is( $db->{MYFILTERkey2}, "MYFILTERvalue2", "We get the right unfiltered value" );
--- /dev/null
+use strict;
+use Test::More tests => 3;
+use Test::Deep;
+use t::common qw( new_fh );
+
+use_ok( 'DBM::Deep' );
+
+my ($fh, $filename) = new_fh();
+my $db = DBM::Deep->new(
+ file => $filename,
+);
+
+is( $db->_dump_file, <<"__END_DUMP__", "Dump of initial file correct" );
+Chains(B):
+Chains(D):
+Chains(I):
+00000030: H 0064 REF: 1
+__END_DUMP__
+
+$db->{foo} = 'bar';
+
+is( $db->_dump_file, <<"__END_DUMP__", "Dump of initial file correct" );
+Chains(B):
+Chains(D):
+Chains(I):
+00000030: H 0064 REF: 1
+00000094: D 0064 bar
+00000158: B 0387
+ 00000545 00000094
+00000545: D 0064 foo
+__END_DUMP__
+