Subject: | autodie's t/mkdir.t fails if build dir path has metachars. |
Date: | Thu, 18 Jun 2015 18:08:48 +0100 |
To: | bug-autodie [...] rt.cpan.org |
From: | Dave Mitchell <davem [...] iabyn.com> |
I've just monkey-patched blead with the following, which will need
back-porting upstream to autodie:
autodie/t/mkdir.t: escape build dir path
This test file creates a regex which includes the path of the build
directory. If that path includes regex metachars (e.g. blead_g++_quick)
then the test fails. Easily fixed with \Q...\E.
--- a/cpan/autodie/t/mkdir.t
+++ b/cpan/autodie/t/mkdir.t
@@ -3,8 +3,8 @@ use strict;
use Test::More;
use FindBin qw($Bin);
use constant TMPDIR => "$Bin/mkdir_test_delete_me";
-use constant ERROR_REGEXP => qr{Can't mkdir\('${\(TMPDIR)}', 0777\):};
-use constant SINGLE_DIGIT_ERROR_REGEXP => qr{Can't mkdir\('${\(TMPDIR)}', 0010\):};
+use constant ERROR_REGEXP => qr{Can't mkdir\('\Q${\(TMPDIR)}\E', 0777\):};
+use constant SINGLE_DIGIT_ERROR_REGEXP => qr{Can't mkdir\('\Q${\(TMPDIR)}\E', 0010\):};
# Delete our directory if it's there
rmdir TMPDIR;
--
If life gives you lemons, you'll probably develop a citric acid allergy.