Commit | Line | Data |
eab60bb1 |
1 | #!./perl |
2 | |
3 | BEGIN { |
4 | unless(grep /blib/, @INC) { |
5 | chdir 't' if -d 't'; |
db5fd395 |
6 | if ($^O eq 'MacOS') { |
7 | @INC = qw(: ::lib ::macos:lib); |
8 | } else { |
9 | @INC = '../lib'; |
10 | } |
eab60bb1 |
11 | } |
12 | } |
13 | |
14 | use Errno; |
15 | |
16 | print "1..5\n"; |
17 | |
18 | print "not " unless @Errno::EXPORT_OK; |
19 | print "ok 1\n"; |
20 | die unless @Errno::EXPORT_OK; |
21 | |
22 | $err = $Errno::EXPORT_OK[0]; |
23 | $num = &{"Errno::$err"}; |
24 | |
25 | print "not " unless &{"Errno::$err"} == $num; |
26 | print "ok 2\n"; |
27 | |
28 | $! = $num; |
29 | print "not " unless $!{$err}; |
30 | print "ok 3\n"; |
31 | |
32 | $! = 0; |
33 | print "not " if $!{$err}; |
34 | print "ok 4\n"; |
35 | |
36 | $s1 = join(",",sort keys(%!)); |
37 | $s2 = join(",",sort @Errno::EXPORT_OK); |
38 | |
3d64f815 |
39 | if($s1 ne $s2) { |
40 | my @s1 = keys(%!); |
41 | my @s2 = @Errno::EXPORT_OK; |
42 | my(%s1,%s2); |
43 | @s1{@s1} = (); |
44 | @s2{@s2} = (); |
45 | delete @s2{@s1}; |
46 | delete @s1{@s2}; |
47 | print "# These are only in \%!\n"; |
48 | print "# ",join(" ",map { "'$_'" } keys %s1),"\n"; |
49 | print "# These are only in \@EXPORT_OK\n"; |
50 | print "# ",join(" ",map { "'$_'" } keys %s2),"\n"; |
51 | print "not "; |
52 | } |
53 | |
eab60bb1 |
54 | print "ok 5\n"; |