my $v_desc = sprintf '%s (%d bit signed int)', $bi, $v_bits;
- my $w;
+ my @w;
+ local $SIG{__WARN__} = sub { $_[0] =~ /datatype mismatch/ ? push @w, @_ : warn @_ };
+
lives_ok {
- local $SIG{__WARN__} = sigwarn_silencer( qr/datatype mismatch/ );
$row = $schema->resultset('BigIntArtist')->create({ bigint => $bi });
- } "Insering value $bi ($v_desc)" or next;
-
- is ($w, undef, 'No mismatch warning on bigints' );
+ } "Insering value ($v_desc)" or next;
# explicitly using eq, to make sure we did not nummify the argument
# which can be an issue on 32 bit ivsize
"value in database correct ($v_desc)"
);
+
+ is_deeply (\@w, [], 'No mismatch warnings on bigint operations' );
}
done_testing;