Commit | Line | Data |
---|---|---|
686c4ca0 NC |
1 | #!perl |
2 | use strict; | |
3 | use warnings; | |
4 | ||
5 | BEGIN { | |
6 | require './test.pl'; | |
7 | } | |
8 | ||
9 | plan(tests => 3); | |
10 | ||
11 | my $nonfile = tempfile(); | |
12 | ||
13 | @INC = qw(Perl Rules); | |
14 | ||
15 | eval { | |
16 | require $nonfile; | |
17 | }; | |
18 | ||
19 | like $@, qr/^Can't locate $nonfile in \@INC \(\@INC contains: @INC\) at/; | |
20 | ||
21 | eval { | |
22 | require "$nonfile.ph"; | |
23 | }; | |
24 | ||
25 | like $@, qr/^Can't locate $nonfile\.ph in \@INC \(did you run h2ph\?\) \(\@INC contains: @INC\) at/; | |
26 | ||
27 | eval { | |
28 | require "$nonfile.h"; | |
29 | }; | |
30 | ||
31 | like $@, qr/^Can't locate $nonfile\.h in \@INC \(change \.h to \.ph maybe\?\) \(did you run h2ph\?\) \(\@INC contains: @INC\) at/; | |
32 | ||
33 | # I can't see how to test the EMFILE case | |
34 | # I can't see how to test the case of not displaying @INC in the message. | |
35 | # (and does that only happen on VMS?) |