This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Reinstate require error messages for .h and .ph
[perl5.git] / t / op / require_errors.t
CommitLineData
686c4ca0
NC
1#!perl
2use strict;
3use warnings;
4
5BEGIN {
6 require './test.pl';
7}
8
9plan(tests => 3);
10
11my $nonfile = tempfile();
12
13@INC = qw(Perl Rules);
14
15eval {
16 require $nonfile;
17};
18
19like $@, qr/^Can't locate $nonfile in \@INC \(\@INC contains: @INC\) at/;
20
21eval {
22 require "$nonfile.ph";
23};
24
25like $@, qr/^Can't locate $nonfile\.ph in \@INC \(did you run h2ph\?\) \(\@INC contains: @INC\) at/;
26
27eval {
28 require "$nonfile.h";
29};
30
31like $@, 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?)