From: rkinyon Date: Mon, 1 May 2006 02:23:06 +0000 (+0000) Subject: r11687@rob-kinyons-powerbook58: rob | 2006-04-29 23:33:57 -0400 X-Git-Tag: 0-99_03~51 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8dee06cd2bf9a8792e21335f280f0e74225ef2e6;p=dbsrgits%2FDBM-Deep.git r11687@rob-kinyons-powerbook58: rob | 2006-04-29 23:33:57 -0400 Added the failing test for import() tying stuff when it shouldn't --- diff --git a/t/17_import.t b/t/17_import.t index 6a91e2d..27f469b 100644 --- a/t/17_import.t +++ b/t/17_import.t @@ -2,7 +2,7 @@ # DBM::Deep Test ## use strict; -use Test::More tests => 2; +use Test::More tests => 6; use Test::Deep; use t::common qw( new_fh ); @@ -35,7 +35,7 @@ $db->import( $struct ); cmp_deeply( $db, - { + noclass({ key1 => 'value1', key2 => 'value2', array1 => [ 'elem0', 'elem1', 'elem2', ], @@ -44,6 +44,14 @@ cmp_deeply( subkey2 => "subvalue2", subkey3 => useclass( bless {}, 'Foo' ), }, - }, + }), "Everything matches", ); + +$struct->{foo} = 'bar'; +is( $struct->{foo}, 'bar', "\$struct has foo and it's 'bar'" ); +ok( !exists $db->{foo}, "\$db doesn't have the 'foo' key, so \$struct is not tied" ); + +$struct->{hash1}->{foo} = 'bar'; +is( $struct->{hash1}->{foo}, 'bar', "\$struct->{hash1} has foo and it's 'bar'" ); +ok( !exists $db->{hash1}->{foo}, "\$db->{hash1} doesn't have the 'foo' key, so \$struct->{hash1} is not tied" );