This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Enhance lfs tests: check every seek and sysseek
[perl5.git] / t / lib / errno.t
CommitLineData
eab60bb1
GS
1#!./perl
2
3BEGIN {
4 unless(grep /blib/, @INC) {
5 chdir 't' if -d 't';
93430cb4 6 unshift @INC, '../lib' if -d '../lib';
eab60bb1
GS
7 }
8}
9
10use Errno;
11
12print "1..5\n";
13
14print "not " unless @Errno::EXPORT_OK;
15print "ok 1\n";
16die unless @Errno::EXPORT_OK;
17
18$err = $Errno::EXPORT_OK[0];
19$num = &{"Errno::$err"};
20
21print "not " unless &{"Errno::$err"} == $num;
22print "ok 2\n";
23
24$! = $num;
25print "not " unless $!{$err};
26print "ok 3\n";
27
28$! = 0;
29print "not " if $!{$err};
30print "ok 4\n";
31
32$s1 = join(",",sort keys(%!));
33$s2 = join(",",sort @Errno::EXPORT_OK);
34
3d64f815
GB
35if($s1 ne $s2) {
36 my @s1 = keys(%!);
37 my @s2 = @Errno::EXPORT_OK;
38 my(%s1,%s2);
39 @s1{@s1} = ();
40 @s2{@s2} = ();
41 delete @s2{@s1};
42 delete @s1{@s2};
43 print "# These are only in \%!\n";
44 print "# ",join(" ",map { "'$_'" } keys %s1),"\n";
45 print "# These are only in \@EXPORT_OK\n";
46 print "# ",join(" ",map { "'$_'" } keys %s2),"\n";
47 print "not ";
48}
49
eab60bb1 50print "ok 5\n";