From 9fdd5a7ac74817cfaab65f7284f98ea66faca324 Mon Sep 17 00:00:00 2001 From: "Matthew Horsfall (alh)" Date: Mon, 31 Mar 2014 08:25:33 -0400 Subject: 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). --- t/run/flib/t2.pm | 5 +++++ t/run/flib/t2.pmc | 5 +++++ t/run/switchM.t | 10 +++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 t/run/flib/t2.pm create mode 100644 t/run/flib/t2.pmc (limited to 't/run') 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"); -- cgit v1.2.1