fix regex stringification test for perl 5.14 (RT#68098)
Rafael Kitover [Wed, 11 May 2011 04:59:45 +0000 (04:59 +0000)]
Changes
t/08helper.t

diff --git a/Changes b/Changes
index eba4447..5df8166 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
 Revision history for Perl extension Catalyst::Model::DBIC::Schema
 
+        - fix regex stringification test for perl 5.14 (RT#68098)
+
 0.48  Thu Dec  9 21:08:33 UTC 2010
         - fix usage of Try::Tiny in helper
 
index 748242e..27df355 100644 (file)
@@ -73,11 +73,12 @@ $i = instance(args => [$static, q{components=TimeStamp,Foo}]);
 is_deeply $i->components, ['InflateColumn::DateTime', 'TimeStamp', 'Foo'],
     'two extra components';
 
+my $flags = qr// =~ /\^/ ? '^' : "-xism";
 $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},
-    q{qr/(?-xism:^(foo|bar)$)/},
+    qq{qr/(?$flags:^(foo|bar)\$)/},
     'constraint loader arg as string';
 
 $i = instance(args => [$static, q{exclude=^(foo|bar)$}]);