release current version of persistence module
tla [Sun, 7 Dec 2014 19:58:18 +0000 (20:58 +0100)]
persistence/CHANGES
persistence/Makefile.PL
persistence/lib/Text/Tradition/Directory.pm
persistence/t/text_tradition_directory.t

index eb28bdb..e1598ed 100644 (file)
@@ -1,3 +1,8 @@
+*** Version 1.2, 07/12/2014
+
+- Workaround for a UTF-8 encoding bug when using MySQL as the storage backend
+
+
 *** Version 1.1, 23/09/2012
 
 commit 3f54eb870cf3bae380898dbe0c21ec7a22a2c8eb
index 76c0391..a3475a9 100644 (file)
@@ -23,4 +23,5 @@ requires( 'YAML::XS' );
 requires( 'namespace::clean' );
 build_requires( 'Test::Warn' );
 build_requires( 'Test::Memory::Cycle' );
+build_requires( 'Test::More::UTF8' );
 &WriteAll;
index 3afc469..ec8462e 100644 (file)
@@ -20,7 +20,7 @@ use Text::Tradition::TypeMap::Entry;
 extends 'KiokuX::Model';
 
 use vars qw/ $VERSION /;
-$VERSION = "1.1";
+$VERSION = "1.2";
 
 =head1 NAME
 
@@ -185,25 +185,35 @@ ok( $nt->$_isa('Text::Tradition'), "Made new tradition" );
                        is( $e->ident, 'database error', "Got exception trying to fetch stemma directly" );
                        like( $e->message, qr/not a Text::Tradition/, "Exception has correct message" );
                }
-               try {
-                       $f->delete( $sid );
-               } catch( Text::Tradition::Error $e ) {
-                       is( $e->ident, 'database error', "Got exception trying to delete stemma directly" );
-                       like( $e->message, qr/Cannot directly delete non-Tradition object/, 
-                               "Exception has correct message" );
+               if( $ENV{TEST_DELETION} ) {
+                       try {
+                               $f->delete( $sid );
+                       } catch( Text::Tradition::Error $e ) {
+                               is( $e->ident, 'database error', "Got exception trying to delete stemma directly" );
+                               like( $e->message, qr/Cannot directly delete non-Tradition object/, 
+                                       "Exception has correct message" );
+                       }
                }
        }
        
-       $f->delete( $uuid );
-       ok( !$f->exists( $uuid ), "Object is deleted from DB" );
-       ok( !$f->exists( $sid ), "Object stemma also deleted from DB" ) if $stemma_enabled;
-       is( scalar $f->traditionlist, 1, "Object is deleted from index" );
+       SKIP: {
+               skip "Set TEST_DELETION in env to test DB deletion functionality", 3
+                       unless $ENV{TEST_DELETION};
+               $f->delete( $uuid );
+               ok( !$f->exists( $uuid ), "Object is deleted from DB" );
+               ok( !$f->exists( $sid ), "Object stemma also deleted from DB" ) if $stemma_enabled;
+               is( scalar $f->traditionlist, 1, "Object is deleted from index" );
+       }
 }
 
 {
        my $g = Text::Tradition::Directory->new( 'dsn' => $dsn );
        my $scope = $g->new_scope;
-       is( scalar $g->traditionlist, 1, "Now one object in new directory index" );
+       SKIP: {
+               skip "Set TEST_DELETION in env to test DB deletion functionality", 1
+                       unless $ENV{TEST_DELETION};
+               is( scalar $g->traditionlist, 1, "Now one object in new directory index" );
+       }
        my $ntobj = $g->tradition( 'CX' );
        my @w1 = sort { $a->sigil cmp $b->sigil } $ntobj->witnesses;
        my @w2 = sort{ $a->sigil cmp $b->sigil } $nt->witnesses;
index bbf8ce0..e99c82b 100644 (file)
@@ -86,25 +86,35 @@ ok( $nt->$_isa('Text::Tradition'), "Made new tradition" );
                        is( $e->ident, 'database error', "Got exception trying to fetch stemma directly" );
                        like( $e->message, qr/not a Text::Tradition/, "Exception has correct message" );
                }
-               try {
-                       $f->delete( $sid );
-               } catch( Text::Tradition::Error $e ) {
-                       is( $e->ident, 'database error', "Got exception trying to delete stemma directly" );
-                       like( $e->message, qr/Cannot directly delete non-Tradition object/, 
-                               "Exception has correct message" );
+               if( $ENV{TEST_DELETION} ) {
+                       try {
+                               $f->delete( $sid );
+                       } catch( Text::Tradition::Error $e ) {
+                               is( $e->ident, 'database error', "Got exception trying to delete stemma directly" );
+                               like( $e->message, qr/Cannot directly delete non-Tradition object/, 
+                                       "Exception has correct message" );
+                       }
                }
        }
        
-       $f->delete( $uuid );
-       ok( !$f->exists( $uuid ), "Object is deleted from DB" );
-       ok( !$f->exists( $sid ), "Object stemma also deleted from DB" ) if $stemma_enabled;
-       is( scalar $f->traditionlist, 1, "Object is deleted from index" );
+       SKIP: {
+               skip "Set TEST_DELETION in env to test DB deletion functionality", 3
+                       unless $ENV{TEST_DELETION};
+               $f->delete( $uuid );
+               ok( !$f->exists( $uuid ), "Object is deleted from DB" );
+               ok( !$f->exists( $sid ), "Object stemma also deleted from DB" ) if $stemma_enabled;
+               is( scalar $f->traditionlist, 1, "Object is deleted from index" );
+       }
 }
 
 {
        my $g = Text::Tradition::Directory->new( 'dsn' => $dsn );
        my $scope = $g->new_scope;
-       is( scalar $g->traditionlist, 1, "Now one object in new directory index" );
+       SKIP: {
+               skip "Set TEST_DELETION in env to test DB deletion functionality", 1
+                       unless $ENV{TEST_DELETION};
+               is( scalar $g->traditionlist, 1, "Now one object in new directory index" );
+       }
        my $ntobj = $g->tradition( 'CX' );
        my @w1 = sort { $a->sigil cmp $b->sigil } $ntobj->witnesses;
        my @w2 = sort{ $a->sigil cmp $b->sigil } $nt->witnesses;