]> git.vpit.fr Git - perl/modules/Regexp-Wildcards.git/blob - t/23-groups.t
Major rewrite
[perl/modules/Regexp-Wildcards.git] / t / 23-groups.t
1 #!perl -T
2
3 use strict;
4 use warnings;
5
6 use Test::More tests => 6;
7
8 use Regexp::Wildcards;
9
10 my $rw = Regexp::Wildcards->new(do => [ qw/jokers brackets groups/ ]);
11
12 is($rw->convert('a(?)b'), 'a(.)b',                'groups: single');
13 is($rw->convert('a(*)b'), 'a(.*)b',               'groups: any');
14 is($rw->convert('(a),(b)'), '(a)\\,(b)',          'groups: commas');
15 is($rw->convert('a({x,y})b'), 'a((?:x|y))b',      'groups: brackets');
16 is($rw->convert('a({x,(y?),{z,(t*u)}})b'), 'a((?:x|(y.)|(?:z|(t.*u))))b',
17                                                   'groups: nested');
18 is($rw->convert('(a*\\(b?\\))'), '(a.*\\(b.\\))', 'groups: escape');