10 plan skip_all => 'hardcoded values are wrong under the debugger';
12 plan tests => 29 + 13 * 2;
16 use Scope::Upper qw<:words>;
18 # This test is for internal use only and doesn't imply any kind of future
19 # compatibility on what the words should actually return.
21 is HERE, 0, 'main : here';
22 is TOP, 0, 'main : top';
23 is UP, 0, 'main : up';
24 is SUB, undef, 'main : sub';
25 is EVAL, undef, 'main : eval';
28 is HERE, 1, '{ 1 } : here';
29 is TOP, 0, '{ 1 } : top';
30 is UP, 0, '{ 1 } : up';
34 is HERE, 1, 'do { 1 } : here';
35 is SUB, undef, 'do { 1 } : sub';
36 is EVAL, undef, 'do { 1 } : eval';
40 is HERE, 1, 'eval { 1 } : here';
41 is SUB, undef, 'eval { 1 } : sub';
42 is EVAL, 1, 'eval { 1 } : eval';
46 is HERE, 1, 'eval "1" : here';
47 is SUB, undef, 'eval "1" : sub';
48 is EVAL, 1, 'eval "1" : eval';
52 is HERE, 1, 'do { 1 } while (0) : here';
56 is HERE, 1, 'sub { 1 } : here';
57 is SUB, 1, 'sub { 1 } : sub';
58 is EVAL, undef, 'sub { 1 } : eval';
62 is HERE, 1, 'for () { 1 } : here';
71 is HERE, 6, 'mixed : here';
72 is TOP, 0, 'mixed : top';
73 is SUB, 4, 'mixed : first sub';
74 is SUB(SUB), 4, 'mixed : still first sub';
75 is EVAL, 5, 'mixed : first eval';
76 is EVAL(EVAL), 5, 'mixed : still first eval';
77 is EVAL(UP(EVAL)), 2, 'mixed : second eval';
86 is SCOPE, 1, 'block : scope';
87 is SCOPE(0), 1, 'block : scope 0';
88 is SCOPE(1), 0, 'block : scope 1';
89 is CALLER, 0, 'block: caller';
90 is CALLER(0), 0, 'block : caller 0';
91 is CALLER(1), 0, 'block : caller 1';
93 is SCOPE, 2, 'block sub : scope';
94 is SCOPE(0), 2, 'block sub : scope 0';
95 is SCOPE(1), 1, 'block sub : scope 1';
96 is CALLER, 2, 'block sub : caller';
97 is CALLER(0), 2, 'block sub : caller 0';
98 is CALLER(1), 0, 'block sub : caller 1';
100 is SCOPE, 3, 'block sub for : scope';
101 is SCOPE(0), 3, 'block sub for : scope 0';
102 is SCOPE(1), 2, 'block sub for : scope 1';
103 is CALLER, 2, 'block sub for : caller';
104 is CALLER(0), 2, 'block sub for : caller 0';
105 is CALLER(1), 0, 'block sub for : caller 1';
107 is SCOPE, 4, 'block sub for eval : scope';
108 is SCOPE(0), 4, 'block sub for eval : scope 0';
109 is SCOPE(1), 3, 'block sub for eval : scope 1';
110 is SCOPE(2), 2, 'block sub for eval : scope 2';
111 is CALLER, 4, 'block sub for eval : caller';
112 is CALLER(0), 4, 'block sub for eval : caller 0';
113 is CALLER(1), 2, 'block sub for eval : caller 1';
114 is CALLER(2), 0, 'block sub for eval : caller 2';