Skip to content

Commit 386f6d7

Browse files
committed
Correct signature/declaration binding tests.
A declarator is needed to cause actual binding.
1 parent 3ec12fb commit 386f6d7

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

S02-names-vars/signature.t

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,36 +10,29 @@ plan 12;
1010
#L<S02/Names and Variables/"A signature object">
1111

1212
{
13-
my $a;
1413
ok :($a) ~~ Signature, ':($a) create a Signature object';
15-
:($a) := 3;
16-
#?rakudo 2 todo 'signature binding'
14+
my ($a) := \3;
1715
is $a, 3, 'can bind to one-element signature';
1816
dies_ok { $a++ }, 'cannot increment an Int';
1917

2018
my $b = :();
2119
ok $b.WHAT === Signature, '.WHAT on :() is Signature';
2220
}
2321

24-
25-
#?rakudo 2 todo 'signature binding'
2622
{
27-
my ($x, $y, $z);
28-
:($x,$y,$z) := (1,2,3);
23+
my ($x,$y,$z) := (1,2,3);
2924
is("$x $y $z", "1 2 3", "siglist bindings works");
3025
}
3126

3227
# Same, but more complex
3328
{
34-
my ($x, @y, @rest);
35-
:($x,@y,*@rest) := (42,[13,17],5,6,7);
29+
my ($x,@y,*@rest) := (42,[13,17],5,6,7);
3630
#?pugs todo 'feature'
3731
is("$x!{@y}!{@rest}", "42!13 17!5 6 7", "complex siglist bindings works (1)");
3832
}
3933

4034
{
41-
my ($x);
42-
:($x?) := ();
35+
my ($x?) := ();
4336
ok(!$x.defined, "complex siglist bindings works (2)");
4437
}
4538

0 commit comments

Comments
 (0)