6 use blib 't/re-engine-Hooks-TestDist';
8 use Test::More tests => 2 * 2;
10 # Those tests must be ran inside eval STRING because the test distribution
11 # can hold only one callback at a time.
17 use re::engine::Hooks::TestDist 'custom' => sub { push @nodes, @_ };
26 is $@, '', 'calling perl code in the exec hook does not croak';
27 is_deeply \@nodes, [ qw<REG_ANY TRIE STAR END> ],
28 'calling perl code in the exec hook works correctly';
37 use re::engine::Hooks::TestDist 'custom' => sub { $res += ("durp" =~ /.urp/) };
46 is $@, '', 'a regexp match in the exec hook does not croak';
47 is $res, scalar(@nodes), 'a regexp match in the exec hook works correctly';