5 use Test::More tests => 2;
6 use File::Temp qw( tempfile tempdir );
7 use Fcntl qw( :flock );
11 my $dir = tempdir( CLEANUP => 1 );
15 my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
17 my $db = DBM::Deep->new( $filename );
20 # Create structure in DB
25 array1 => [ "elem0", "elem1", "elem2", { foo => 'bar' }, [ 5 ] ],
27 subkey1 => "subvalue1",
28 subkey2 => "subvalue2",
35 $struct = $db->export();
39 # Make sure everything is here, outside DB
42 ($struct->{key1} eq "value1") &&
43 ($struct->{key2} eq "value2") &&
45 ($struct->{array1}->[0] eq "elem0") &&
46 ($struct->{array1}->[1] eq "elem1") &&
47 ($struct->{array1}->[2] eq "elem2") &&
48 ($struct->{array1}->[3]{foo} eq "bar") &&
49 ($struct->{array1}->[4][0] eq "5")
52 ($struct->{hash1}->{subkey1} eq "subvalue1") &&
53 ($struct->{hash1}->{subkey2} eq "subvalue2")