This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove unneeded 'use' from ext/XS-APItest/t/peep.t Devel::Peek is not used by ext...
[perl5.git] / ext / XS-APItest / t / peep.t
CommitLineData
201c7e1f
FR
1#!perl
2
3use strict;
4use warnings;
5use Test::More tests => 9;
6
7use XS::APItest;
8
201c7e1f
FR
9my $record = XS::APItest::peep_record;
10my $rrecord = XS::APItest::rpeep_record;
11
12# our peep got called and remembered the string constant
13XS::APItest::peep_enable;
14eval q[my $foo = q/affe/];
15XS::APItest::peep_disable;
16
17is(scalar @{ $record }, 1);
18is(scalar @{ $rrecord }, 1);
19is($record->[0], 'affe');
20is($rrecord->[0], 'affe');
21
22
23# peep got called for each root op of the branch
24$::moo = $::moo = 0;
25XS::APItest::peep_enable;
26eval q[my $foo = $::moo ? q/x/ : q/y/];
27XS::APItest::peep_disable;
28
29is(scalar @{ $record }, 1);
30is(scalar @{ $rrecord }, 2);
31is($record->[0], 'y');
32is($rrecord->[0], 'x');
33is($rrecord->[1], 'y');