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