1) forgot to add some t/5* tests to the MANIFEST 2) The one line patch to Engine...
[dbsrgits/DBM-Deep.git] / t / 53_misc_transactions.t
1
2 # This was discussed here:
3 # http://groups.google.com/group/DBM-Deep/browse_thread/thread/a6b8224ffec21bab
4 # brought up by Alex Gallichotte
5
6 use strict;
7 use Test;
8 use DBM::Deep;
9 use t::common qw( new_fh );
10
11 my ($fh, $filename) = new_fh();
12 my $db = DBM::Deep->new( file => $filename, fh => $fh, );
13
14 plan tests => 3;
15
16 eval { $db->{randkey()} = randkey() for 1 .. 10; }; ok($@, "");
17
18 eval {
19     $db->begin_work;
20     $db->{randkey()} = randkey() for 1 .. 10;
21     $db->commit;
22 };
23 ok($@, '');
24
25 eval { $db->{randkey()} = randkey() for 1 .. 10; }; ok($@, "");
26
27 sub randkey {
28     our $i ++;
29     my @k = map { int rand 100 } 1 .. 10;
30     local $" = "-";
31
32     return "$i-@k";
33 }