This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RT-121512 - Allow -I/dir/ with trailing slash to find .pmc files.
[perl5.git] / t / run / switchM.t
1 #!./perl
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = '../lib';
6 }
7 use strict;
8
9 require './test.pl';
10
11 plan(4);
12
13 like(runperl(switches => ['-Irun/flib', '-Mbroken'], stderr => 1),
14      qr/^Global symbol "\$x" requires explicit package name at run\/flib\/broken.pm line 6\./,
15      "Ensure -Irun/flib produces correct filename in warnings");
16
17 like(runperl(switches => ['-Irun/flib/', '-Mbroken'], stderr => 1),
18      qr/^Global symbol "\$x" requires explicit package name at run\/flib\/broken.pm line 6\./,
19      "Ensure -Irun/flib/ produces correct filename in warnings");
20
21 like(runperl(switches => ['-Irun/flib', '-Mt2', '-e "print t2::id()"'], stderr => 1),
22      qr/^t2pmc$/,
23      "Ensure -Irun/flib loads pmc");
24
25 like(runperl(switches => ['-Irun/flib/', '-Mt2', '-e "print t2::id()"'], stderr => 1),
26      qr/^t2pmc$/,
27      "Ensure -Irun/flib/ loads pmc");