t/run/dtrace.pl For dtrace.t
t/run/dtrace.t Test for DTrace probes
t/run/exit.t Test perl's exit status.
+t/run/flib/broken.pm Bad .pm file for switchM.t
t/run/fresh_perl.t Tests that require a fresh perl.
t/run/locale.t Tests related to locale handling
t/run/mad.t Test vs MAD environment
t/run/switchF1.t Pathological tests for the -F switch
t/run/switchF.t Test the -F switch
t/run/switchI.t Test the -I switch
+t/run/switchM.t Test the -M switch
t/run/switchn.t Test the -n switch
t/run/switchp.t Test the -p switch
t/run/switcht.t Test the -t switch
memcpy(tmp, dir, dirlen);
tmp +=dirlen;
- *tmp++ = '/';
+
+ /* Avoid '<dir>//<file>' */
+ if (!dirlen || *(tmp-1) != '/') {
+ *tmp++ = '/';
+ }
+
/* name came from an SV, so it will have a '\0' at the
end that we can copy as part of this memcpy(). */
memcpy(tmp, name, len + 1);
--- /dev/null
+package broken;
+
+use strict;
+use warnings;
+
+$x = 1;
+
+1;
--- /dev/null
+#!./perl
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+}
+use strict;
+
+require './test.pl';
+
+plan(2);
+
+like(runperl(switches => ['-Irun/flib', '-Mbroken'], stderr => 1),
+ qr/^Global symbol "\$x" requires explicit package name at run\/flib\/broken.pm line 6\./,
+ "Ensure -Irun/flib produces correct filename in warnings");
+
+like(runperl(switches => ['-Irun/flib/', '-Mbroken'], stderr => 1),
+ qr/^Global symbol "\$x" requires explicit package name at run\/flib\/broken.pm line 6\./,
+ "Ensure -Irun/flib/ produces correct filename in warnings");