Skip closed STDIN tests under PERL_UNICODE
Skips tee and leak tests for closed STDIN on Perl prior to 5.12 when
PERL_UNICODE=D. Documented lack of support as a known issue.
David Golden
11 years ago
596 | 596 |
captured to ensure that the filehandle used for capture is not opened to file
|
597 | 597 |
descriptor 0, as this causes problems on various platforms.
|
598 | 598 |
|
|
599 |
Prior to Perl 5.12, closed STDIN combined with PERL_UNICODE=D leaks filehandles
|
|
600 |
and also breaks tee() for undiagnosed reasons. So don't do that.
|
|
601 |
|
599 | 602 |
*Localized filehandles*
|
600 | 603 |
|
601 | 604 |
If code localizes any of Perl's standard filehandles before capturing, the capture
|
36 | 36 |
);
|
37 | 37 |
|
38 | 38 |
if ( ! $no_fork ) {
|
39 | |
run_test($_) for qw(
|
40 | |
tee
|
41 | |
tee_scalar
|
42 | |
tee_stdout
|
43 | |
tee_stderr
|
44 | |
tee_merged
|
45 | |
);
|
|
39 |
# prior to 5.12, PERL_UNICODE=D causes problems when STDIN is closed
|
|
40 |
# before capturing. No idea why. Documented as a known issue.
|
|
41 |
if ( $] lt '5.012' && ${^UNICODE} & 24 ) {
|
|
42 |
diag 'Skipping tee() tests because PERL_UNICODE=D not supported';
|
|
43 |
}
|
|
44 |
else {
|
|
45 |
run_test($_) for qw(
|
|
46 |
tee
|
|
47 |
tee_scalar
|
|
48 |
tee_stdout
|
|
49 |
tee_stderr
|
|
50 |
tee_merged
|
|
51 |
);
|
|
52 |
}
|
46 | 53 |
}
|
47 | 54 |
|
48 | |
is( next_fd, $fd, "no file descriptors leaked" );
|
|
55 |
if ( $] lt '5.012' && ${^UNICODE} & 24 ) {
|
|
56 |
diag 'Skipping leak test because PERL_UNICODE=D not supported';
|
|
57 |
}
|
|
58 |
else {
|
|
59 |
is( next_fd, $fd, "no file descriptors leaked" );
|
|
60 |
}
|
|
61 |
|
49 | 62 |
restore_std(qw/stdin/);
|
50 | 63 |
|
51 | 64 |
exit 0;
|