Reactivated a test for multi-DB cross-reference
rkinyon [Mon, 4 Dec 2006 15:23:51 +0000 (15:23 +0000)]
lib/DBM/Deep/Engine3.pm
t/19_crossref.t [moved from t/19_crossref.todo with 76% similarity]

index 2ab984d..89b14ed 100644 (file)
@@ -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 );
similarity index 76%
rename from t/19_crossref.todo
rename to t/19_crossref.t
index bd432c8..fcd48eb 100644 (file)
@@ -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;
 }