X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100populate.t;h=df7533a06a1b0c4bbcc3a9fd1fe99db403c59b20;hb=8428e0b6d206d21201046fe454902fcaaa16fe64;hp=b6ea7d9470857f293e760321497809b5acd881d5;hpb=75a1d824dae50a309db204be15ef46aa52b1deb5;p=dbsrgits%2FDBIx-Class.git diff --git a/t/100populate.t b/t/100populate.t index b6ea7d9..df7533a 100644 --- a/t/100populate.t +++ b/t/100populate.t @@ -6,6 +6,7 @@ use Test::Exception; use Test::Warn; use lib qw(t/lib); use DBICTest; +use DBIx::Class::_Util 'sigwarn_silencer'; use Path::Class::File (); use Math::BigInt; use List::Util qw/shuffle/; @@ -209,6 +210,11 @@ is($link7->title, 'gtitle', 'Link 7 title'); my $rs = $schema->resultset('Artist'); $rs->delete; throws_ok { + # this warning is correct, but we are not testing it here + # what we are after is the correct exception when an int + # fails to coerce into a sqlite rownum + local $SIG{__WARN__} = sigwarn_silencer( qr/datatype mismatch.+ foo as integer/ ); + $rs->populate([ { artistid => 1, @@ -223,7 +229,7 @@ throws_ok { name => 'foo3', }, ]); -} qr/\Qexecute_for_fetch() aborted with 'datatype mismatch\E\b/, 'bad slice'; +} qr/\Qexecute_for_fetch() aborted with 'datatype mismatch\E\b/, 'bad slice fails PK insert'; is($rs->count, 0, 'populate is atomic'); @@ -398,18 +404,7 @@ warnings_like { ); $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 2 -], 'Data integrity warnings as planned'; +} [], 'Data integrity warnings gone as planned'; lives_ok { $schema->resultset('TwoKeys')->populate([{