This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update Encode to CPAN version 2.78
[perl5.git] / t / io / semctl.t
1 BEGIN {
2   chdir 't' if -d 't';
3   @INC = '../lib' if -d '../lib' && -d '../ext';
4
5   require "./test.pl";
6   require Config; import Config;
7 }
8
9 use strict;
10 use warnings;
11
12 skip_all('no SysV semaphores on this platform') if !$Config{d_sem};
13
14 my @warnings;
15 {
16     local $SIG{__WARN__} = sub { push @warnings, $_[0] };
17     local $SIG{SYS} = sub { skip_all("SIGSYS caught") } if exists $SIG{SYS};
18     my $test = (semctl(-1,0,0,0))[0];
19     ok(!defined $test, "erroneous semctl list slice yields undef");
20 }
21
22 is(scalar @warnings, 0, "no warnings from erroneous semctl list slice")
23     or diag("warnings found: @warnings");
24
25 done_testing;