Add a test as well in t/106dbic_carp.t .
- Cleanup of complex resultset update/delete oprations - storage
specific code moved back to ResultSet and replaced by checks
of storage capabilities
+ - Fixed carp_once only emitting one single warning per package
+ regardless of warning content
0.08196 2011-11-29 05:35 (UTC)
* Fixes
);
};
- my $fired;
+ my $fired = {};
*{"${into}::carp_once"} = sub {
- return if $fired;
- $fired = 1;
+ return if $fired->{$_[0]};
+ $fired->{$_[0]} = 1;
$warn->(
__find_caller($skip_pattern, $into),
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Warn;
+use DBIx::Class::Carp;
+use lib 't/lib';
+use DBICTest;
+
+warnings_exist {
+ DBIx::Class::frobnicate();
+} [
+ qr/carp1/,
+ qr/carp2/,
+], 'expected warnings from carp_once';
+
+done_testing;
+
+sub DBIx::Class::frobnicate {
+ DBIx::Class::branch1();
+ DBIx::Class::branch2();
+}
+
+sub DBIx::Class::branch1 { carp_once 'carp1' }
+sub DBIx::Class::branch2 { carp_once 'carp2' }