Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
RT# 125324: "is default" should distribute over a list of variables
  • Loading branch information
moritz committed Jun 5, 2015
1 parent 76e600f commit 8319ef6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion S02-names/is_default.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 114;
plan 118;

# L<S02/Variables Containing Undefined Values>

Expand Down Expand Up @@ -36,6 +36,22 @@ plan 114;
ok $d.VAR.default === Nil, 'is the default set correctly for $d';
} #19

# RT 125324
{
my ($a, $b) is default(42);
is $a, 42, 'is default() works on a group of variables too (1)';
is $b, 42, 'is default() works on a group of variables too (2)';
}
#?rakudo skip 'is default on attributes'
{
my class A {
has ($.x, $.y) is default(23);
}
my $obj = A.new(x => 5);
is $obj.x, 5, 'is default on attributes: basic sanity';
is $obj.y, 42, 'is default on attributes applies to all in a list';
}

#?niecza skip "Int is default NYI"
# typed
{
Expand Down

0 comments on commit 8319ef6

Please sign in to comment.