Skip to content

Commit

Permalink
added tests for RT #100560, #102876 and #117083
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed May 9, 2013
1 parent 9780900 commit 8c3db86
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion S04-declarations/our.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 20;
plan 26;

# L<S04/The Relationship of Blocks and Declarations/"our $foo" introduces a lexically scoped alias>
our $a = 1;
Expand Down Expand Up @@ -67,4 +67,20 @@ our $c = 42; #OK not used
eval_dies_ok('$d1', 'our() variable not yet visible outside its package');
}

#?rakudo 4 todo 'RT #100560, #102876'
{
lives_ok { our @e1 = 1..3 }, 'we can declare and initialize an our-scoped array';
lives_ok { our %e2 = a => 1 }, 'we can declare and initialize an our-scoped hash';
is(@e1[1], 2, 'our-scoped array has correct value' );
is(%e2<a>, 1, 'our-scoped hash has correct value' );
}

#?rakudo 2 todo 'RT #117083'
{
our @f1;
our %f2;
ok(@f1 ~~ Hash, 'our-declared @-sigil var is an Array');
ok(%f2 ~~ Array, 'our-declared %-sigil var is a Hash');
}

# vim: ft=perl6

0 comments on commit 8c3db86

Please sign in to comment.