summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorMatthew Horsfall (alh) <wolfsage@gmail.com>2014-03-31 08:25:33 -0400
committerMatthew Horsfall (alh) <wolfsage@gmail.com>2014-04-07 12:46:26 -0400
commit9fdd5a7ac74817cfaab65f7284f98ea66faca324 (patch)
tree3dd7c55b70458c258f2954c66da0494526304050 /t/run
parent00f8bca2b46dcb7174bde0d4010176254f0c8eaa (diff)
downloadperl-9fdd5a7ac74817cfaab65f7284f98ea66faca324.tar.gz
RT-121512 - Allow -I/dir/ with trailing slash to find .pmc files.
6b0bdd7f2041803dc3ec72b53d28052705861967 updated -I to not add a trailing '/' if one was already present, but failed to update the length of the resulting SV to account for the lack of another character. This caused later checks based off of that length to fail (in this case, seeing if the last 3 characters of the string are .pm).
Diffstat (limited to 't/run')
-rw-r--r--t/run/flib/t2.pm5
-rw-r--r--t/run/flib/t2.pmc5
-rw-r--r--t/run/switchM.t10
3 files changed, 19 insertions, 1 deletions
diff --git a/t/run/flib/t2.pm b/t/run/flib/t2.pm
new file mode 100644
index 0000000000..172a14e4b0
--- /dev/null
+++ b/t/run/flib/t2.pm
@@ -0,0 +1,5 @@
+package t2;
+
+sub id { "t2pm" }
+
+1;
diff --git a/t/run/flib/t2.pmc b/t/run/flib/t2.pmc
new file mode 100644
index 0000000000..e3894bc07b
--- /dev/null
+++ b/t/run/flib/t2.pmc
@@ -0,0 +1,5 @@
+package t2;
+
+sub id { "t2pmc" }
+
+1;
diff --git a/t/run/switchM.t b/t/run/switchM.t
index 72e8908b01..6a751009fc 100644
--- a/t/run/switchM.t
+++ b/t/run/switchM.t
@@ -8,7 +8,7 @@ use strict;
require './test.pl';
-plan(2);
+plan(4);
like(runperl(switches => ['-Irun/flib', '-Mbroken'], stderr => 1),
qr/^Global symbol "\$x" requires explicit package name at run\/flib\/broken.pm line 6\./,
@@ -17,3 +17,11 @@ like(runperl(switches => ['-Irun/flib', '-Mbroken'], stderr => 1),
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', '-Mt2', '-e "print t2::id()"'], stderr => 1),
+ qr/^t2pmc$/,
+ "Ensure -Irun/flib loads pmc");
+
+like(runperl(switches => ['-Irun/flib/', '-Mt2', '-e "print t2::id()"'], stderr => 1),
+ qr/^t2pmc$/,
+ "Ensure -Irun/flib/ loads pmc");