]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/blob - t/11-commas.t
Update .gitignore
[perl/modules/Regexp-Wildcards.git] / t / 11-commas.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 8;
7
8 use Regexp::Wildcards qw/wc2re_unix wc2re_win32/;
9
10 ok(wc2re_unix('a,b,c') eq 'a\\,b\\,c', 'unix: commas outside of brackets 1');
11 ok(wc2re_unix('a\\,b\\\\\\,c') eq 'a\\,b\\\\\\,c',
12    'unix: commas outside of brackets 2');
13 ok(wc2re_unix(',a,b,c\\\\,') eq '\\,a\\,b\\,c\\\\\\,',
14    'unix: commas outside of brackets at begin/ed');
15
16 ok(wc2re_win32('a,b\\\\,c') eq '(?:a|b\\\\|c)', 'win32: commas');
17 ok(wc2re_win32('a\\,b\\\\,c') eq '(?:a\\,b\\\\|c)', 'win32: escaped commas 1');
18 ok(wc2re_win32('a\\,b\\\\\\,c') eq 'a\\,b\\\\\\,c', 'win32: escaped commas 2');
19
20 ok(wc2re_win32(',a,b\\\\,') eq '(?:|a|b\\\\|)', 'win32: commas at begin/end');
21 ok(wc2re_win32('\\,a,b\\\\\\,') eq '(?:\\,a|b\\\\\\,)',
22    'win32: escaped commas at begin/end');