summaryrefslogtreecommitdiff
path: root/lib/open.t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2011-09-19 15:20:04 +1000
committerTony Cook <tony@develop-help.com>2011-09-19 15:20:04 +1000
commitf76f2ef3c7d81e60b94f6106b3bd46f8449b469f (patch)
tree22ed8ec491434eac80e2525286676bbef6c67e3a /lib/open.t
parent82a9156664ed01c033a5792e4668ab6ab83c941a (diff)
downloadperl-f76f2ef3c7d81e60b94f6106b3bd46f8449b469f.tar.gz
clear $ENV{PERL_UNICODE} before runperl()ing a test of use open.
If PERL_UNICODE was set to a value that modified stream behaviour, the test added in 73f1eaca would fail, because the implied -C option would cause the behaviour the test was checking wouldn't happen.
Diffstat (limited to 'lib/open.t')
-rw-r--r--lib/open.t34
1 files changed, 19 insertions, 15 deletions
diff --git a/lib/open.t b/lib/open.t
index 586d8e2c38..2f2a04adb4 100644
--- a/lib/open.t
+++ b/lib/open.t
@@ -195,21 +195,25 @@ SKIP: {
"test for an endless loop in PerlIO_find_layer");
}
-is runperl(
- progs => [
- 'use open q\:encoding(UTF-8)\, q-:std-;',
- 'use open q\:encoding(UTF-8)\;',
- 'if(($_ = <STDIN>) eq qq-\x{100}\n-) { print qq-stdin ok\n- }',
- 'else { print qq-got -, join(q q q, map ord, split//), "\n" }',
- 'print STDOUT qq-\x{ff}\n-;',
- 'print STDERR qq-\x{ff}\n-;',
- ],
- stdin => "\xc4\x80\n",
- stderr => 1,
- ),
- "stdin ok\n\xc3\xbf\n\xc3\xbf\n",
- "use open without :std does not affect standard handles",
-;
+{
+ local $ENV{PERL_UNICODE};
+ delete $ENV{PERL_UNICODE};
+ is runperl(
+ progs => [
+ 'use open q\:encoding(UTF-8)\, q-:std-;',
+ 'use open q\:encoding(UTF-8)\;',
+ 'if(($_ = <STDIN>) eq qq-\x{100}\n-) { print qq-stdin ok\n- }',
+ 'else { print qq-got -, join(q q q, map ord, split//), "\n" }',
+ 'print STDOUT qq-\x{ff}\n-;',
+ 'print STDERR qq-\x{ff}\n-;',
+ ],
+ stdin => "\xc4\x80\n",
+ stderr => 1,
+ ),
+ "stdin ok\n\xc3\xbf\n\xc3\xbf\n",
+ "use open without :std does not affect standard handles",
+ ;
+}
END {
1 while unlink "utf8";