Fixed t/13 on Leopard and a couple issues with no_plan on newer Test::More installati...
[dbsrgits/DBM-Deep.git] / t / 48_autoexport_after_delete.t
CommitLineData
edd45134 1use 5.006;
2
3use strict;
4use warnings FATAL => 'all';
5
40df5605 6use Test::More tests => 2;
edd45134 7use Test::Deep;
8
9use t::common qw( new_fh );
10
11use_ok( 'DBM::Deep' );
12
13{
14 my ($fh, $filename) = t::common::new_fh();
15 my $db = DBM::Deep->new(
16 file => $filename,
17 fh => $fh,
18 );
19
20 # Add a self-referencing connection to test export
21 my %struct = (
22 key1 => "value1",
23 key2 => "value2",
24 array1 => [ "elem0", "elem1", "elem2", { foo => 'bar' }, [ 5 ], bless( [], 'Apple' ) ],
25 hash1 => {
26 subkey1 => "subvalue1",
27 subkey2 => "subvalue2",
28 subkey3 => bless( {
29 sub_obj => bless([
30 bless([], 'Foo'),
31 ], 'Foo'),
32 sub_obj3 => bless([],'Foo'),
33 }, 'Foo' ),
34 },
35 );
36
37 $db->{foo} = \%struct;
38
39 my $x = delete $db->{foo};
40
41 cmp_deeply(
42 $x,
43 {
44 key1 => "value1",
45 key2 => "value2",
46 array1 => [ "elem0", "elem1", "elem2", { foo => 'bar' }, [ 5 ], bless( [], 'Apple' ) ],
47 hash1 => {
48 subkey1 => "subvalue1",
49 subkey2 => "subvalue2",
50 subkey3 => bless( {
51 sub_obj => bless([
52 bless([], 'Foo'),
53 ], 'Foo'),
54 sub_obj3 => bless([],'Foo'),
55 }, 'Foo' ),
56 },
57 },
58 "Everything matches",
59 );
60}
61
62__END__