[svn:parrot] r40263 - trunk/t/tools

fperrad at svn.parrot.org fperrad at svn.parrot.org
Sat Jul 25 08:11:49 UTC 2009


Author: fperrad
Date: Sat Jul 25 08:11:48 2009
New Revision: 40263
URL: https://trac.parrot.org/parrot/changeset/40263

Log:
[pgegrep] fix test on Windows.
backslash must be escaped in regex

Modified:
   trunk/t/tools/pgegrep.t

Modified: trunk/t/tools/pgegrep.t
==============================================================================
--- trunk/t/tools/pgegrep.t	Sat Jul 25 07:16:38 2009	(r40262)
+++ trunk/t/tools/pgegrep.t	Sat Jul 25 08:11:48 2009	(r40263)
@@ -27,6 +27,8 @@
 use File::Spec   ();
 
 my $testdata = File::Spec->catfile(qw{. t tools testdata });
+my $testdata_escaped = $testdata;
+$testdata_escaped =~ s!\\!\\\\!g;
 
 sub pgegrep_output_like {
     my ($options, $snippet, $desc)  = @_;
@@ -66,13 +68,13 @@
 
 pgegrep_output_like(
     "-H cat $testdata",
-    qr!$testdata:keyboardcat!,
+    qr!$testdata_escaped:keyboardcat!,
     'matching a literal with file name'
 );
 
 pgegrep_output_like(
     "--with-filename cat $testdata",
-    qr!$testdata:keyboardcat!,
+    qr!$testdata_escaped:keyboardcat!,
     'matching a literal with file name with long option'
 );
 
@@ -91,15 +93,16 @@
 
 pgegrep_output_like(
     "-l cat $testdata",
-    qr!$testdata!,
+    qr!$testdata_escaped!,
     'find files that match'
 );
 
 pgegrep_output_like(
     "--files-with-matches cat $testdata",
-    qr!$testdata!,
+    qr!$testdata_escaped!,
     'find files that match with long option'
 );
+
 # Local Variables:
 #   mode: cperl
 #   cperl-indent-level: 4


More information about the parrot-commits mailing list