File: fileno.t

package info (click to toggle)
libio-all-perl 0.87-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 712 kB
  • sloc: perl: 2,017; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 577 bytes parent folder | download | duplicates (4)
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
use strict; use warnings;
use lib -e 't' ? 't' : 'test';
use Test::More;
use IO::All;
use IO_All_Test;

plan((lc($^O) eq 'mswin32' and defined $ENV{PERL5_CPANPLUS_IS_RUNNING})
    ? (skip_all => "CPANPLUS/MSWin32 breaks this")
    : ($] < 5.008003)
      ? (skip_all => 'Broken on older perls')
      : (tests => 7)
);

is(io('-')->mode('<')->open->fileno, 0);
is(io('-')->mode('>')->open->fileno, 1);
is(io('=')->fileno, 2);

is(io->stdin->fileno, 0);
is(io->stdout->fileno, 1);
is(io->stderr->fileno, 2);

ok(io(o_dir() . '/xxx')->open('>')->fileno > 2);


del_output_dir();