From: Vincent Pit Date: Tue, 19 Aug 2008 15:19:14 +0000 (+0200) Subject: Add intermediate newlines tests X-Git-Tag: v1.01~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=14908481700fa4d093dae4a10e4f89ea19106e91;p=perl%2Fmodules%2FRegexp-Wildcards.git Add intermediate newlines tests --- diff --git a/t/20-jokers.t b/t/20-jokers.t index 61b1ad6..3b21478 100644 --- a/t/20-jokers.t +++ b/t/20-jokers.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 2 * (4 + 2 + 7 + 9 + 2) * 3; +use Test::More tests => 2 * (4 + 2 + 7 + 8 + 6 + 2) * 3; use Regexp::Wildcards; @@ -78,14 +78,20 @@ sub alltests { # Escaping try $rw, "escaping $any", '\\'.$any; + try $rw, "escaping $any before intermediate newline", '\\'.$any ."\n\\".$any; try $rw, "escaping $one", '\\'.$one; + try $rw, "escaping $one before intermediate newline", '\\'.$one ."\n\\".$one; try $rw, "escaping \\\\\\$any", '\\\\\\'.$any; try $rw, "escaping \\\\\\$one", '\\\\\\'.$one; - try $rw, "not escaping \\\\$any", '\\\\'.$any, '\\\\.*'; try $rw, "not escaping \\\\$one", '\\\\'.$one, '\\\\.'; + # Escaping escapes + try $rw, 'escaping \\', '\\', '\\\\'; + try $rw, 'not escaping \\', '\\\\', '\\\\'; + try $rw, 'escaping \\ before intermediate newline', "\\\n\\", "\\\\\n\\\\"; + try $rw, 'not escaping \\ before intermediate newline', "\\\\\n\\\\", "\\\\\n\\\\"; try $rw, 'escaping regex characters', '[]', '\\[\\]'; try $rw, 'not escaping escaped regex characters', '\\\\\\[\\]'; diff --git a/t/21-commas.t b/t/21-commas.t index 1cdd0d0..2e07443 100644 --- a/t/21-commas.t +++ b/t/21-commas.t @@ -13,7 +13,7 @@ is($rw->convert('a,b,c'), 'a\\,b\\,c', 'unix: commas outside of brackets 1'); is($rw->convert('a\\,b\\\\\\,c'), 'a\\,b\\\\\\,c', 'unix: commas outside of brackets 2'); is($rw->convert(',a,b,c\\\\,'), '\\,a\\,b\\,c\\\\\\,', - 'unix: commas outside of brackets at begin/ed'); + 'unix: commas outside of brackets at begin/end'); $rw = Regexp::Wildcards->new(type => 'commas');