From: rkinyon Date: Mon, 4 Dec 2006 15:23:51 +0000 (+0000) Subject: Reactivated a test for multi-DB cross-reference X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=25eb38b86e53f80195693aafeadd380ca84ace50;p=dbsrgits%2FDBM-Deep.git Reactivated a test for multi-DB cross-reference --- diff --git a/lib/DBM/Deep/Engine3.pm b/lib/DBM/Deep/Engine3.pm index 2ab984d..89b14ed 100644 --- a/lib/DBM/Deep/Engine3.pm +++ b/lib/DBM/Deep/Engine3.pm @@ -218,10 +218,10 @@ sub write_value { } elsif ( $r eq 'ARRAY' || $r eq 'HASH' ) { if ( $r eq 'ARRAY' && tied(@$value) ) { - DBM::Deep->_throw_error( "Cannot store something that is tied" ); + DBM::Deep->_throw_error( "Cannot store something that is tied." ); } if ( $r eq 'HASH' && tied(%$value) ) { - DBM::Deep->_throw_error( "Cannot store something that is tied" ); + DBM::Deep->_throw_error( "Cannot store something that is tied." ); } $class = 'DBM::Deep::Engine::Sector::Reference'; $type = substr( $r, 0, 1 ); diff --git a/t/19_crossref.todo b/t/19_crossref.t similarity index 76% rename from t/19_crossref.todo rename to t/19_crossref.t index bd432c8..fcd48eb 100644 --- a/t/19_crossref.todo +++ b/t/19_crossref.t @@ -26,12 +26,15 @@ my $db2 = DBM::Deep->new( $filename2 ); ); is( $db->{hash1}{subkey1}, 'subvalue1', "Value imported correctly" ); is( $db->{hash1}{subkey2}, 'subvalue2', "Value imported correctly" ); - ## - # Cross-ref nested hash accross DB objects - ## + + # Test cross-ref nested hash accross DB objects throws_ok { $db2->{copy} = $db->{hash1}; - } qr/Cannot cross-reference\. Use export\(\) instead/, "cross-ref fails"; + } qr/Cannot store something that is tied\./, "cross-ref fails"; + + # This error text is for when internal cross-refs are implemented + #} qr/Cannot cross-reference\. Use export\(\) instead\./, "cross-ref fails"; + $db2->{copy} = $db->{hash1}->export; }