From: Dave Rolsky Date: Sat, 22 Oct 2011 00:37:00 +0000 (-0500) Subject: Fix test failure with Perl 5.8.8 X-Git-Tag: 2.0302~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=afd879e0642fb7c7cab9e8a134d2d17d8cde4356;p=gitmo%2FMoose.git Fix test failure with Perl 5.8.8 --- diff --git a/t/roles/imported_required_method.t b/t/roles/imported_required_method.t index ce44640..d37faa0 100644 --- a/t/roles/imported_required_method.t +++ b/t/roles/imported_required_method.t @@ -32,9 +32,12 @@ BEGIN { package Class; use Moose; use ExportsFoo 'foo'; + + # The grossness near the end of the regex works around a bug with \Q not + # escaping \& properly with perl 5.8.x ::like( ::exception { with 'Foo' }, - qr/^\Q'Foo' requires the method 'foo' to be implemented by 'Class'. If you imported functions intending to use them as methods, you need to explicitly mark them as such, via Class->meta->add_method(foo => \&foo)/, + qr/^\Q'Foo' requires the method 'foo' to be implemented by 'Class'. If you imported functions intending to use them as methods, you need to explicitly mark them as such, via Class->meta->add_method(foo => \E\\\&foo\)/, "imported 'method' isn't seen" ); Class->meta->add_method(foo => \&foo);