5 use Test::More tests => 2;
6 use File::Temp qw( tempfile tempdir );
10 my $dir = tempdir( CLEANUP => 1 );
11 my ($fh, $filename) = tempfile( 'tmpXXXX', UNLINK => 1, DIR => $dir );
12 my $db = DBM::Deep->new( $filename );
15 # Create structure in memory
20 array1 => [ "elem0", "elem1", "elem2" ],
22 subkey1 => "subvalue1",
23 subkey2 => "subvalue2"
30 $db->import( $struct );
34 # Make sure everything is there
37 ($db->{key1} eq "value1") &&
38 ($db->{key2} eq "value2") &&
40 ($db->{array1}->[0] eq "elem0") &&
41 ($db->{array1}->[1] eq "elem1") &&
42 ($db->{array1}->[2] eq "elem2")
45 ($db->{hash1}->{subkey1} eq "subvalue1") &&
46 ($db->{hash1}->{subkey2} eq "subvalue2")