Skip to content

Commit

Permalink
[t/spec] Couple of tests for lexicals with & sigil.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@23108 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
jnthn committed Nov 26, 2008
1 parent 47b0b1d commit 0db6c09
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions S04-declarations/my.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 30;
plan 32;

#L<S04/The Relationship of Blocks and Declarations/"declarations, all
# lexically scoped declarations are visible">
Expand All @@ -22,7 +22,14 @@ plan 30;
{
my $ret = 42;
lives_ok { $ret = (my $x) ~ $x }, 'my() variable is visible (1)';
is $ret, "", 'my() variable is visible (2)';
is $ret, "", 'my() variable is visible (2)';
}

{
sub answer { 42 }
my &fortytwo = &answer;
is &fortytwo(), 42, 'my variable with & sigil works (1)';
is fortytwo(), 42, 'my variable with & sigil works (2)';
}

#?rakudo skip 'pointy subs'
Expand Down

0 comments on commit 0db6c09

Please sign in to comment.