1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!./perl
#
# tests for default output handle
# DAPM 30/4/10 this area seems to have been undertested. For now, the only
# tests are ensuring things don't crash when PL_defoutgv isn't a GV;
# it probably needs expanding at some point to cover other stuff.
BEGIN {
chdir 't' if -d 't';
require './test.pl';
set_up_inc('../lib');
}
plan tests => 16;
my $stdout = *STDOUT;
select($stdout);
$stdout = 1; # whoops, PL_defoutgv no longer a GV!
# XXX It is a GV as of 5.13.7. Is this test file needed any more?
# note that in the tests below, the return values aren't as important
# as the fact that they don't crash
ok print(""), 'print';
ok select(), 'select';
$a = 'fooo';
format STDOUT =
@ @<<
"#", $a
.
ok((write())[0], 'write');
ok($^, '$^');
ok($~, '$~');
ok($=, '$=');
ok($-, '$-');
is($%, 0, '$%');
is($|, 0, '$|');
$^ = 1; pass '$^ = 1';
$~ = 1; pass '$~ = 1';
$= = 1; pass '$= = 1';
$- = 1; pass '$- = 1';
$% = 1; pass '$% = 1';
$| = 1; pass '$| = 1';
# Switch to STDERR for this test, so we do not lose our test output
my $stderr = *STDERR;
select($stderr);
$stderr = 1;
ok close(), 'close';
|