summaryrefslogtreecommitdiff
path: root/t/io/defout.t
blob: dda3b4c997d04806f6e9b3b82a69db7df2ecc530 (plain)
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
#!./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';
    @INC = '../lib';
    require './test.pl';
}

plan tests => 16;


my $stderr = *STDERR;
select($stderr);
$stderr = 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 STDERR =
#@<<
$a;
.
ok ! write(), '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';
ok close(), 'close';