Codebase list libcapture-tiny-perl / 2ea479c
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
2 changed file(s) with 24 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
596596 captured to ensure that the filehandle used for capture is not opened to file
597597 descriptor 0, as this causes problems on various platforms.
598598
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
599602 *Localized filehandles*
600603
601604 If code localizes any of Perl's standard filehandles before capturing, the capture
3636 );
3737
3838 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 }
4653 }
4754
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
4962 restore_std(qw/stdin/);
5063
5164 exit 0;