3 Test the C<mod> or C<modifiers> method
8 use Test::More tests => 25;
11 sub { cmp_ok shift, 'eq', '', => 'no flags' },
12 sub { cmp_ok shift, 'eq', '', => '/c' },
13 sub { cmp_ok shift, 'eq', '' => '/g' },
14 sub { cmp_ok shift, 'eq', 'i' => '/i' },
15 sub { cmp_ok shift, 'eq', 'm' => '/m' },
16 sub { cmp_ok shift, 'eq', '' => '/o' },
17 sub { cmp_ok shift, 'eq', 's' => '/s' },
18 sub { cmp_ok shift, 'eq', 'x' => '/x' },
19 sub { cmp_ok shift, 'eq', 'p' => '/p' },
20 sub { like $_[0], qr/$_/ => "/$_ in $_[0]" for unpack "(Z)*", "xi" },
21 sub { like $_[0], qr/$_/ => "/$_ in $_[0]" for unpack "(Z)*", "xs" },
23 for (unpack "(Z)*", "cgimsxp") {
25 like $_[0], qr/$_/ => "/$_ in $_[0]"
28 sub { cmp_ok shift, 'eq', '', => '/e' },
30 for (unpack "(Z)*", "egimsxp") {
32 like $_[0], qr/$_/ => "/$_ in $_[0]";
36 sub { cmp_ok shift, 'eq', '' => '??' },
37 # Leave this as the last
38 ,sub { die "add more tests" }
41 use re::engine::Plugin (
49 my $mod_str = join '', keys %mod;
55 # Provide a pattern that can match to avoid running into regexp
56 # optimizations that won't call exec on C<"" =~ //>;
59 "" =~ /x/cg; # meaningless without /g