5 use Test::More tests => 6;
9 my $record = XS::APItest::peep_record;
10 my $rrecord = XS::APItest::rpeep_record;
12 # our peep got called and remembered the string constant
13 XS::APItest::peep_enable;
14 eval q[my $foo = q/affe/];
15 XS::APItest::peep_disable;
17 is(scalar @{ $record }, 1);
18 is(scalar @{ $rrecord }, 1);
19 is($record->[0], 'affe');
20 is($rrecord->[0], 'affe');
23 # A deep-enough nesting of conditionals defeats the deferring mechanism
24 # and triggers recursion. Note that this test is sensitive to the details
25 # rpeep: the main thing it is testing is that rpeep is called more than
26 # peep, and that all branches are covered; the order of branch calling is
29 my $code = q[my ($a,$b); $a =];
30 $code .= qq{ \$b ? "foo$_" :} for (1..10);
31 $code .= qq{ "foo11" };
32 XS::APItest::peep_enable;
34 XS::APItest::peep_disable;
36 is_deeply($record, [ "foo11" ]);
38 qw(foo1 foo2 foo3 foo4 foo5 foo6 foo10 foo9 foo8 foo7 foo11) ]);