summaryrefslogtreecommitdiff
path: root/t/op/magic.t
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2012-08-15 09:02:12 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2012-08-15 09:02:12 +0100
commit1070c8d6ea3781940b822c1474f591b8f511dddf (patch)
tree6a5f6e93d9750132833fad402ddcfdfd4a331c66 /t/op/magic.t
parent44db81561237fa7e17ad3f897e6f643a1c77f44a (diff)
downloadperl-1070c8d6ea3781940b822c1474f591b8f511dddf.tar.gz
Fix t/op/magic.t on Windows
These tests have been failing since they were added by 613c63b465, but we can now fix them using new Win32 APIs.
Diffstat (limited to 't/op/magic.t')
-rw-r--r--t/op/magic.t4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/op/magic.t b/t/op/magic.t
index ebf99a7ee5..38e4fd0e4d 100644
--- a/t/op/magic.t
+++ b/t/op/magic.t
@@ -70,7 +70,11 @@ sub env_is {
if ($Is_MSWin32) {
# cmd.exe will echo 'variable=value' but 4nt will echo just the value
# -- Nikola Knezevic
+ require Win32;
+ my $cp = Win32::GetConsoleOutputCP();
+ Win32::SetConsoleOutputCP(Win32::GetACP());
(my $set = `set $key`) =~ s/\r\n$/\n/;
+ Win32::SetConsoleOutputCP($cp);
like $set, qr/^(?:\Q$key\E=)?\Q$val\E$/, $desc;
} elsif ($Is_VMS) {
is `write sys\$output f\$trnlnm("\Q$key\E")`, "$val\n", $desc;