6 sub export { 'export' };
10 use Test::More no_plan => 1;
12 use_ok( 'DBM::Deep' );
15 my $db = DBM::Deep->new(
20 die "ERROR: " . $db->error();
28 $db->{blessed} = $obj;
30 $db->{unblessed} = {};
31 $db->{unblessed}{a} = 1;
32 $db->{unblessed}{b} = [];
33 $db->{unblessed}{b}[0] = 1;
34 $db->{unblessed}{b}[1] = 2;
35 $db->{unblessed}{b}[2] = 3;
39 my $db2 = DBM::Deep->new(
45 die "ERROR: " . $db2->error();
48 my $obj2 = $db2->{blessed};
49 isa_ok( $obj2, 'Foo' );
50 can_ok( $obj2, 'export', 'foo' );
51 ok( !$obj2->can( 'STORE' ), "... but it cannot 'STORE'" );
54 is( $obj2->{b}[0], 1 );
55 is( $obj2->{b}[1], 2 );
56 is( $obj2->{b}[2], 3 );
58 is( $db2->{unblessed}{a}, 1 );
59 is( $db2->{unblessed}{b}[0], 1 );
60 is( $db2->{unblessed}{b}[1], 2 );
61 is( $db2->{unblessed}{b}[2], 3 );
63 my $db3 = DBM::Deep->new(
69 die "ERROR: " . $db3->error();
72 my $obj3 = $db3->{blessed};
73 isa_ok( $obj3, 'DBM::Deep' );
74 can_ok( $obj3, 'export', 'STORE' );
75 ok( !$obj3->can( 'foo' ), "... but it cannot 'foo'" );
78 is( $obj3->{b}[0], 1 );
79 is( $obj3->{b}[1], 2 );
80 is( $obj3->{b}[2], 3 );
82 is( $db3->{unblessed}{a}, 1 );
83 is( $db3->{unblessed}{b}[0], 1 );
84 is( $db3->{unblessed}{b}[1], 2 );
85 is( $db3->{unblessed}{b}[2], 3 );