doy / parse-keyword

DEPRECATED: write syntax extensions in perl
http://metacpan.org/release/Parse-Keyword
5 stars 4 forks source link

t/fun/name.t fails #7

Closed abraxxa closed 11 years ago

abraxxa commented 11 years ago

I assume this is related to my locale, note the "" instead of the tested '' around the abc in the second line or the error:

#   Failed test at t/fun/name.t line 32.
#                   'abc 123 at t/fun/name.t line 22.
#       Foo::foo("abc", 123) called at t/fun/name.t line 26
#       eval {...} called at t/fun/name.t line 25
# '
#     doesn't match '(?^:^abc 123 at t/fun/name.t line 22\.?\n\tFoo::foo\('abc', 123\) called at t/fun/name.t line 26)'
# Looks like you failed 1 test of 2.
t/fun/name.t ..................
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests

brewed Perl 5.18.1 -Duserelocatableinc -Dusethreads

[ahartmai@ahartmai-nb:~/perl5/git/p5-mop-redux$ (master)]$ env | grep LC LC_PAPER=de_AT.UTF-8 LC_ADDRESS=de_AT.UTF-8 LC_MONETARY=de_AT.UTF-8 LC_NUMERIC=de_AT.UTF-8 LC_TELEPHONE=de_AT.UTF-8 LC_IDENTIFICATION=de_AT.UTF-8 LC_MEASUREMENT=de_AT.UTF-8 LC_TIME=de_AT.UTF-8 LC_NAME=de_AT.UTF-8

aero commented 11 years ago

Hi, I have the same problem on Windows strawberry perl.

On windows, the return message from Carp::confess is

abc 123 at name.t line 22.
        Foo::foo("abc", 123) called at name.t line 26
        eval {...} called at name.t line 25

So fun/name.t 's regex can't match.

The following is the patch for that.

--- t\fun\name.t.org    Thu Oct 10 11:49:33 2013
+++ t\fun\name.t    Thu Oct 10 11:58:26 2013
@@ -29,7 +29,7 @@
     my $line_confess = $line + 6;
     my $line_foo = $line + 10;

-    ::like($@, qr/^abc 123 at $file line $line_confess\.?\n\tFoo::foo\('abc', 123\) called at $file line $line_foo/);
+    ::like($@, qr/^abc 123 at $file line $line_confess\.?\n\tFoo::foo\(['"]abc['"], 123\) called at $file line $line_foo/);
 }

 SKIP: { skip "Sub::Name required", 1 unless eval { require Sub::Name };
doy commented 11 years ago

It's actually an issue with the formatting in newer versions of Carp. Fixed in 3a7d7eb.