Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 29 lines (20 sloc) 0.671 kB
b254a8b [gsoc_spectest] Test reorganization.
Auzon authored
1 use v6;
2
3 use Test;
4
5 plan 4;
6
7
8 # L<S06/The C<&?ROUTINE> object/current routine name>
9 # L<S02/Names/Which routine am I in>
10 sub foo { return &?ROUTINE.name }
11 is(foo(), '&Main::foo', 'got the right routine name in the default package');
12
13 {
14 # This testcase might be really redundant
f9473b8 [t/spec] semicolon form of package declaration not allowed in subscope
lwall authored
15 package Bar {
16 sub bar { return &?ROUTINE.name }
17 is(bar(), '&Bar::bar', 'got the right routine name outside the default package');
18 }
19 }
b254a8b [gsoc_spectest] Test reorganization.
Auzon authored
20
21 my $bar = sub { return &?ROUTINE.name };
22 is($bar(), '<anon>', 'got the right routine name (anon-block)');
23
24 my $baz = try { &?ROUTINE.name };
5adcc30 @coke pugs fudge
coke authored
25 #?pugs todo
b254a8b [gsoc_spectest] Test reorganization.
Auzon authored
26 ok(not(defined $baz), '&?ROUTINE.name not defined outside of a routine');
7f29bc5 [t/spec] Add vim: lines everywhere.
kyle authored
27
28 # vim: ft=perl6
Something went wrong with that request. Please try again.