Add comprehensive 'report-prereqs'-like tooling
[dbsrgits/DBIx-Class.git] / t / 100populate.t
index e7cb830..5102118 100644 (file)
@@ -6,11 +6,10 @@ use Test::Exception;
 use Test::Warn;
 use lib qw(t/lib);
 use DBICTest;
-use DBIx::Class::_Util 'sigwarn_silencer';
+use DBIx::Class::_Util qw(sigwarn_silencer serialize);
 use Path::Class::File ();
 use Math::BigInt;
 use List::Util qw/shuffle/;
-use Storable qw/nfreeze dclone/;
 
 my $schema = DBICTest->init_schema();
 
@@ -383,9 +382,8 @@ lives_ok {
 } 'literal+bind with semantically identical attrs works after normalization';
 
 # test all kinds of population with stringified objects
+# or with empty sets
 warnings_like {
-  local $ENV{DBIC_RT79576_NOWARN};
-
   my $rs = $schema->resultset('Artist')->search({}, { columns => [qw(name rank)], order_by => 'artistid' });
 
   # the stringification has nothing to do with the artist name
@@ -438,10 +436,15 @@ warnings_like {
       [qw( rank name )],
       [ $rank, $fn ],
     ]},
+
+    'empty set' => { AoA => [
+      [qw( name rank )],
+    ]},
   };
 
   # generate the AoH equivalent based on the AoAs above
   for my $bag (values %$args) {
+    $bag->{AoH} = [];
     my @hdr = @{$bag->{AoA}[0]};
     for my $v ( @{$bag->{AoA}}[1..$#{$bag->{AoA}}] ) {
       push @{$bag->{AoH}}, my $h = {};
@@ -450,7 +453,7 @@ warnings_like {
   }
 
   local $Storable::canonical = 1;
-  my $preimage = nfreeze($args);
+  my $preimage = serialize($args);
 
 
   for my $tst (keys %$args) {
@@ -496,23 +499,12 @@ warnings_like {
   }
 
   ok (
-    ($preimage eq nfreeze($args)),
+    ($preimage eq serialize($args)),
     'Arguments fed to populate()/create() unchanged'
   );
 
   $rs->delete;
-} [
-  # warning to be removed around Apr 1st 2015
-  # smokers start failing a month before that
-  (
-    ( DBICTest::RunMode->is_author and ( time() > 1427846400 ) )
-      or
-    ( DBICTest::RunMode->is_smoker and ( time() > 1425168000 ) )
-  )
-    ? ()
-    # one unique for populate() and create() each
-    : (qr/\QPOSSIBLE *PAST* DATA CORRUPTION detected \E.+\QTrigger condition encountered at @{[ __FILE__ ]} line\E \d/) x 4
-], 'Data integrity warnings as planned';
+} [], 'Data integrity warnings gone as planned';
 
 $schema->is_executed_sql_bind(
   sub {