]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/blob - t/11-commas.t
Importing Regexp-Wildcards-0.01.tar.gz
[perl/modules/Regexp-Wildcards.git] / t / 11-commas.t
1 #!perl -T
2
3 use Test::More tests => 7;
4
5 use Regexp::Wildcards qw/wc2re_unix wc2re_win32/;
6
7 ok((not defined wc2re_unix('a,b,c')), 'unix: no commas allowed out of brackets');
8 ok(wc2re_unix('a\\,b\\\\\\,c') eq 'a\\,b\\\\\\,c', 'unix: no commas allowed out of brackets');
9
10 ok(wc2re_win32('a,b\\\\,c') eq '(?:a|b\\\\|c)', 'win32: commas');
11 ok(wc2re_win32('a\\,b\\\\,c') eq '(?:a\\,b\\\\|c)', 'win32: escaped commas 1');
12 ok(wc2re_win32('a\\,b\\\\\\,c') eq 'a\\,b\\\\\\,c', 'win32: escaped commas 2');
13
14 ok(wc2re_win32(',a,b\\\\,') eq '(?:|a|b\\\\|)', 'win32: commas at begin/end');
15 ok(wc2re_win32('\\,a,b\\\\\\,') eq '(?:\\,a|b\\\\\\,)', 'win32: escaped commas at begin/end');