6 use blib 't/re-engine-Hooks-TestDist';
8 use Test::More tests => 4 * 3;
14 use re::engine::Hooks::TestDist 'foo' => $ops;
19 my $res = "lettuce" =~ /t{2,3}/;
22 is "@$ops", 'c:EXACT c:CURLY c:END', 'match compilation';
24 is "@$ops", 'e:CURLY e:END', 'match execution';
26 ok $res, 'regexp match result';
30 use re::engine::Hooks::TestDist 'foo';
35 my @captures = "babaorum" =~ /([aeiou])/g;
38 is "@$ops", 'c:OPEN c:ANYOF c:CLOSE c:END', 'capture compilation';
40 my $expect = join ' ', ('e:OPEN e:ANYOF e:CLOSE e:END') x 4;
41 is "@$ops", $expect, 'capture execution';
43 is "@captures", 'a a o u', 'regexp capture result';
46 my $expected_comp_branch;
52 use re::engine::Hooks::TestDist 'foo';
57 my $res = "tomato" =~ /t(?:z|.)/g;
60 is "@$ops", 'c:EXACT c:EXACT c:BRANCH c:BRANCH c:REG_ANY c:TAIL c:END',
63 my $expect = join ' ', ('e:EXACT e:BRANCH') x2, 'e:REG_ANY e:END';
64 is "@$ops", $expect, 'branch execution';
66 ok $res, 'branch execution result';
70 use re::engine::Hooks::TestDist 'foo';
75 my $res = "potato" =~ /t(?:z|o)/g;
78 is "@$ops", 'c:EXACT c:EXACT c:BRANCH c:BRANCH c:EXACT c:TAIL c:END c:TRIE',
81 my $expect = join ' ', ('e:EXACT e:TRIE') x2, 'e:END';
82 is "@$ops", $expect, 'trie execution';
84 ok $res, 'trie execution result';