This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[PATCH] Cleanup output from t/io/defout.t RT#78572
[perl5.git] / t / io / defout.t
CommitLineData
099be4f1
DM
1#!./perl
2#
3# tests for default output handle
4
5# DAPM 30/4/10 this area seems to have been undertested. For now, the only
6# tests are ensuring things don't crash when PL_defoutgv isn't a GV;
7# it probably needs expanding at some point to cover other stuff.
8
9BEGIN {
10 chdir 't';
11 @INC = '../lib';
12 require './test.pl';
13}
14
4d2eb54d 15plan tests => 17;
099be4f1
DM
16
17my $stderr = *STDERR;
18select($stderr);
19$stderr = 1; # whoops, PL_defoutgv no longer a GV!
2acc3314 20# XXX It is a GV as of 5.13.7. Is this test file needed any more?
099be4f1
DM
21
22# note that in the tests below, the return values aren't as important
23# as the fact that they don't crash
24
2acc3314
FC
25ok print(""), 'print';
26ok select(), 'select';
4d2eb54d 27next_test();
099be4f1
DM
28format STDERR =
29#@<<
4d2eb54d 30ok 3
099be4f1 31.
4d2eb54d 32ok ! write();
099be4f1 33
2acc3314
FC
34ok($^, '$^');
35ok($~, '$~');
36ok($=, '$=');
37ok($-, '$-');
38is($%, 0, '$%');
099be4f1
DM
39is($|, 0, '$|');
40$^ = 1; pass '$^ = 1';
41$~ = 1; pass '$~ = 1';
42$= = 1; pass '$= = 1';
43$- = 1; pass '$- = 1';
44$% = 1; pass '$% = 1';
45$| = 1; pass '$| = 1';
2acc3314 46ok close(), 'close';
099be4f1 47