Subject: | Tests fail on Windows |
Since Windows has backslashes in file names, the tests fail on Windows
since you insert a variable with the file's name directly in a regular
expression (and so it treats the backslash as a non-literal). You'll
want to surround your variables with \Q and \E in t/10-basics.t.
Patch attached.
Subject: | windows-test-fix.patch |
From 04c6610b1f1a6fc3ec11f3fe6c8820cf86dae4c6 Mon Sep 17 00:00:00 2001
From: Douglas Christopher Wilson <doug@somethingdoug.com>
Date: Tue, 31 Aug 2010 21:58:49 -0400
Subject: Make sure file name is treated as a literal
---
t/10-basics.t | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/10-basics.t b/t/10-basics.t
index 8b6e9e7..8520016 100644
--- a/t/10-basics.t
+++ b/t/10-basics.t
@@ -12,7 +12,7 @@ use Const::Fast;
sub throws_readonly(&@) {
my ($sub, $desc) = @_;
my ($file, $line) = (caller)[1,2];
- my $error = qr/Modification of a read-only value attempted at $file line $line\./;
+ my $error = qr/Modification of a read-only value attempted at \Q$file\E line $line\./;
&throws_ok($sub, $error, $desc);
return;
}
@@ -20,7 +20,7 @@ sub throws_readonly(&@) {
sub throws_reassign(&@) {
my ($sub, $desc) = @_;
my ($file, $line) = (caller)[1,2];
- my $error = qr/Attempt to reassign a readonly \w+ at $file line $line/;
+ my $error = qr/Attempt to reassign a readonly \w+ at \Q$file\E line $line/;
&throws_ok($sub, $error, $desc);
return;
}
--
1.7.0.2.msysgit.0