File: 23-groups.t

package info (click to toggle)
libregexp-wildcards-perl 1.05-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 184 kB
  • sloc: perl: 489; makefile: 2
file content (18 lines) | stat: -rw-r--r-- 649 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!perl -T

use strict;
use warnings;

use Test::More tests => 6;

use Regexp::Wildcards;

my $rw = Regexp::Wildcards->new(do => [ qw<jokers brackets groups> ]);

is($rw->convert('a(?)b'), 'a(.)b',                'groups: single');
is($rw->convert('a(*)b'), 'a(.*)b',               'groups: any');
is($rw->convert('(a),(b)'), '(a)\\,(b)',          'groups: commas');
is($rw->convert('a({x,y})b'), 'a((?:x|y))b',      'groups: brackets');
is($rw->convert('a({x,(y?),{z,(t*u)}})b'), 'a((?:x|(y.)|(?:z|(t.*u))))b',
                                                  'groups: nested');
is($rw->convert('(a*\\(b?\\))'), '(a.*\\(b.\\))', 'groups: escape');