accept B::OP objects from lifted subs
[p5sagit/Devel-BeginLift.git] / t / generate.t
CommitLineData
4d07fd95 1use strict;
2use warnings;
3use Test::More;
4
5BEGIN {
6 plan skip_all => "B::Generate required" unless eval { require B::Generate };
7 plan 'no_plan';
8}
9
10sub foo {
11 B::SVOP->new("const", 0, 42);
12}
13
14use Devel::BeginLift qw(foo);
15
16sub bar { 7 + foo() }
17
18is( bar(), 49, "optree injected" );
19