Converted to using only 2 transactions by default and added the num_txns to the header
[dbsrgits/DBM-Deep.git] / t / 36_transaction_deep.todo
CommitLineData
415dcbb7 1use strict;
7a960a12 2use Test::More tests => 7;
415dcbb7 3use Test::Deep;
4use t::common qw( new_fh );
5
6use_ok( 'DBM::Deep' );
7
8my ($fh, $filename) = new_fh();
a67c4bbf 9my $db = DBM::Deep->new(
415dcbb7 10 file => $filename,
11 locking => 1,
12 autoflush => 1,
36d630c6 13 num_txns => 16,
415dcbb7 14);
15
a67c4bbf 16my $outer = { a => 'b' };
17my $inner = { a => 'c' };
7a960a12 18
a67c4bbf 19$db->{x} = $outer;
20is( $db->{x}{a}, 'b', "BEFORE: We're looking at the right value from outer" );
7a960a12 21
a67c4bbf 22$db->begin_work;
415dcbb7 23
a67c4bbf 24 $db->{x} = $inner;
25 is( $db->{x}{a}, 'c', "WITHIN: We're looking at the right value from inner" );
fb451ba6 26TODO: {
27 local $TODO = "Transactions not done yet";
a67c4bbf 28 is( $outer->{a}, 'b', "WITHIN: We're looking at the right value from outer" );
fb451ba6 29}
415dcbb7 30
a67c4bbf 31$db->commit;
415dcbb7 32
a67c4bbf 33is( $db->{x}{a}, 'c', "AFTER: Commit means inner is still correct" );
fb451ba6 34TODO: {
35 local $TODO = "Transactions not done yet";
a67c4bbf 36is( $outer->{a}, undef, "AFTER: outer made the move" );
fb451ba6 37}
a67c4bbf 38is( $inner->{a}, 'c', "AFTER: inner made the move" );