perl/t/uni/select.t
Nicolas R 624c42e21a Use set_up_inc for several unit tests
Use set_up_inc when require.pl is loaded
move plan outside of BEGIN block
when no tests are run at BEGIN time.

Using set_up_inc allow to run these tests under minitest
but also compile them using B::C.

This also has the advantage to use a single
control point for @INC setup.

Note: some tests cannot use 'require test.pl',
unshfit is then used for them.
2016-08-18 11:14:57 +10:00

36 lines
641 B
Perl

#!./perl
#
# Tests whenever the return value of select(FH) is correctly encoded.
#
BEGIN {
chdir 't' if -d 't';
require './test.pl';
set_up_inc('../lib');
}
use utf8;
use open qw( :utf8 :std );
plan( tests => 5 );
open DÙP, ">&", *STDERR;
open $dùp, ">&", *STDOUT;
open , ">&", *STDERR;
open $ᛞ웊, ">&", *STDOUT;
is select(DÙP), "main::STDOUT";
is select($dùp), "main::DÙP";
TODO: {
local $TODO = "Scalar filehandles not yet clean";
is select(), "main::dùp";
}
is select($ᛞ웊), "main::둪";
TODO: {
local $TODO = "Scalar filehandles not yet clean";
is select(STDOUT), "main::ᛞ웊";
}