File: fileno.t

package info (click to toggle)
libio-all-perl 0.38-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 508 kB
  • ctags: 312
  • sloc: perl: 2,647; makefile: 14
file content (23 lines) | stat: -rw-r--r-- 544 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use lib 't', 'lib';
use strict;
use warnings;
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('t/output/xxx')->open('>')->fileno > 2);