Subject: | [PATCH] t/madness.t fails under non-English locales |
Hardcoding $! strings won't work.
Subject: | t-madness.t.patch |
--- t/madness.t~ 2009-03-24 01:20:35.000000000 +0100
+++ t/madness.t 2009-03-26 18:56:40.000000000 +0100
@@ -221,7 +221,7 @@
NV => 3.14159265358979,
PV => "string",
PV8 => "ab\ncd\x{20ac}\t",
- PVM => $!,
+ PVM => 0+$!, # dualvar, force numeric context
RV => \$.,
AR => [ 1..2 ],
HR => { key => "value" },
@@ -232,7 +232,7 @@
OBJ => bless qr/("[^"]+")/,"Zorp",
);
- same( $dump= $o->Data(\%hash)->Out, <<'EXPECT', "", $o);
+ my $expected7 = <<'EXPECT';
$HASH1 = {
AR => [
1,
@@ -258,12 +258,17 @@
OBJ => bless( qr/("[^"]+")/, 'Zorp' ),
PV => 'string',
PV8 => "ab\ncd\x{20ac}\t",
- PVM => 'Bad file descriptor',
+ PVM => ERRNO,
RV => \do { my $v = undef },
UND => undef
};
EXPECT
+ use Errno qw();
+ my $errno = Errno::EBADF;
+ $expected7 =~ s[ERRNO][$errno];
+ same( $dump= $o->Data(\%hash)->Out, $expected7, "", $o);
+
}
__END__