6 use Test::More tests => 14;
10 use Scope::Upper qw<HERE>;
15 my $here = Scope::Context->new;
16 is $here->cxt, HERE, 'default context';
22 my $here = Scope::Context->new($cxt);
23 is $here->cxt, $cxt, 'forced context';
32 my $here = Scope::Context->new;
34 is $up->cxt, $cxt, 'up(undef)';
41 my $here = Scope::Context->new;
42 my $up1 = $here->up(1);
43 is $up1->cxt, $cxt, 'up(1)';
51 my $up2 = Scope::Context->up(2);
52 is $up2->cxt, $cxt, 'up(2)';
63 my $sub = Scope::Context->new->sub;
64 is $sub->cxt, $cxt, 'sub(undef)';
73 my $sub = Scope::Context->new->sub(0);
74 is $sub->cxt, $cxt, 'sub(0)';
83 my $sub = Scope::Context->sub(1);
84 is $sub->cxt, $cxt, 'sub(1)';
96 my $eval = Scope::Context->new->eval;
97 is $eval->cxt, $cxt, 'eval(undef)';
108 my $eval = Scope::Context->new->eval(0);
109 is $eval->cxt, $cxt, 'eval(0)';
120 my $eval = Scope::Context->eval(1);
121 is $eval->cxt, $cxt, 'eval(1)';
135 $want = Scope::Context->up->want;
139 is $want, undef, 'want: void context';
147 $want = Scope::Context->eval->want;
152 is $want, !1, 'scalar context';
159 $want = Scope::Context->sub->up->want;
163 is $want, 1, 'want: list context';