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