From: Dagfinn Ilmari Mannsåker Date: Mon, 5 May 2014 21:52:27 +0000 (+0100) Subject: Fix t/08helper.t with Data::Dumper >= 2.151 (RT#94599) X-Git-Tag: v0.63~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Model-DBIC-Schema.git;a=commitdiff_plain;h=d71aa88946cf1c2b213af5a7e42898365983a8a0 Fix t/08helper.t with Data::Dumper >= 2.151 (RT#94599) This version should be robust against future changes regex in serialisation, both on perl's and Data::Dumper's part. --- diff --git a/Changes b/Changes index fb5ec02..8ef538a 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for Perl extension Catalyst::Model::DBIC::Schema 0.63 - Make MooseX::MarkAsMethods a hard prerequisite (RT#94923) + - Fix t/08helper.t with Data::Dumper >= 2.151 (RT#94599) 0.62 2014-01-06 12:32:27 - Don't ship MYMETA.* files (RT#91808) diff --git a/t/08helper.t b/t/08helper.t index 09ae5eb..0a08aae 100644 --- a/t/08helper.t +++ b/t/08helper.t @@ -8,6 +8,7 @@ use Test::More; use Test::Exception; use Catalyst::Helper::Model::DBIC::Schema; use Storable 'dclone'; +use Data::Dumper; use Test::Requires qw(Catalyst::Helper DBIx::Class::Schema::Loader); my $helper = Catalyst::Helper->new; @@ -72,12 +73,13 @@ $i = instance(args => [$static, q{components=TimeStamp,Foo}]); is_deeply $i->components, ['InflateColumn::DateTime', 'TimeStamp', 'Foo'], 'two extra components'; -my $flags = qr// =~ /\^/ ? '^' : "-xism"; +# Different versions of perl and Data::Dumper serialise regexes differently +my ($flagstart, $flagend, $postflag) = Dumper(qr//) =~ m{qr/(.*?)(\)?)/([a-z]*)}; $i = instance(args => [$static, q{constraint=^(foo|bar)$}]); is $i->loader_args->{constraint}, qr/^(foo|bar)$/, 'constraint loader arg'; is $i->helper->{loader_args}{constraint}, - qq{qr/(?$flags:^(foo|bar)\$)/}, + qq{qr/$flagstart^(foo|bar)\$$flagend/$postflag}, 'constraint loader arg as string'; $i = instance(args => [$static, q{exclude=^(foo|bar)$}]);