Navigation Menu

Skip to content

Commit

Permalink
remove sigils from | and \
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Sep 3, 2012
1 parent 5397065 commit e6ba01a
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion S02-types/anon_block.t
Expand Up @@ -143,7 +143,7 @@ isnt((sub { -> { 3 } }).(), 3, 'as are pointies');
#?niecza skip 'No candidates for dispatch to mone'
#?pugs skip 'parsefail'
{
proto mone(|$) { * }
proto mone(|) { * }
multi mone { 'one' }
is &mone(), 'one', 'check that mutli is callable via &';
is { &^x() }.( &mone ), 'one',
Expand Down
4 changes: 2 additions & 2 deletions S02-types/capture.t
Expand Up @@ -54,7 +54,7 @@ plan 21;
# L<S06/Argument list binding/single scalar parameter marked>
{
sub bar6 ($a, $b, $c) { "$a!$b!$c" }
sub foo6 (|$capture) { bar6(|$capture) }
sub foo6 (|capture) { bar6(|capture) }

#?pugs todo "feature"
is foo6(1,2,3), "1!2!3",
Expand All @@ -75,7 +75,7 @@ plan 21;
# Arglists are first-class objects
{
my $capture;
sub foo7 (|$args) { $capture = $args }
sub foo7 (|args) { $capture = args }

lives_ok { foo7(1,2,3,4) }, "captures are first-class objects (1)";
#?pugs todo "feature"
Expand Down
2 changes: 1 addition & 1 deletion S02-types/sigils-and-types.t
Expand Up @@ -60,7 +60,7 @@ ok &foo.does(Callable), 'a Sub does Callable';
method meth {}
ok &meth.does(Callable), 'a Method does Callable';
}
proto mul(|$) {*}
proto mul(|) {*}
multi mul {}
ok &mul.does(Callable), 'a multi does Callable';
proto pro {}
Expand Down
2 changes: 1 addition & 1 deletion S06-multi/syntax.t
Expand Up @@ -161,7 +161,7 @@ ok(~&foo ~~ /foo/, 'a multi stringifies sensibly');
}

multi with_cap($a) { $a }
multi with_cap($a,$b,|$cap) { return with_cap($a + $b, |$cap) }
multi with_cap($a,$b,|cap) { return with_cap($a + $b, |cap) }
#?pugs skip 'with_cap not found'
is with_cap(1,2,3,4,5,6), 21, 'captures in multi sigs work';

Expand Down
12 changes: 6 additions & 6 deletions S06-signature/introspection.t
Expand Up @@ -114,11 +114,11 @@ sub j(*@i) {
#?niecza skip "Action method fakesignature not yet implemented"
{
my $x;
ok :(|$x).params[0].capture, 'prefix | makes .capture true';
ok :(|$x).perl ~~ / '|' /, 'prefix | appears in .perl output';
ok :(|x).params[0].capture, 'prefix | makes .capture true';
ok :(|x).perl ~~ / '|' /, 'prefix | appears in .perl output';

ok :(\$x).params[0].parcel, 'prefix \\ makes .parcel true';
ok :(\$x).perl ~~ / '\\' /, 'prefix \\ appears in .perl output';
ok :(\x).params[0].parcel, 'prefix \\ makes .parcel true';
ok :(\x).perl ~~ / '\\' /, 'prefix \\ appears in .perl output';
}

# RT #69492
Expand All @@ -130,8 +130,8 @@ sub j(*@i) {

# Capture param introspection
{
sub xyz(|$c) {};
is &xyz.signature.params[0].name, '$c' , '.name of |$c is "$c"';
sub xyz(|c) {};
is &xyz.signature.params[0].name, 'c' , '.name of |c is "c"';
#?niecza todo "Does this test make sense?"
is &xyz.signature.params[0].positional, False, '.positional on Capture param is False';
is &xyz.signature.params[0].capture, True , '.capture on Capture param is True';
Expand Down
2 changes: 1 addition & 1 deletion S12-methods/multi.t
Expand Up @@ -51,7 +51,7 @@ role R2 {
}
eval_dies_ok 'class X does R1 does R2 { }', 'sanity: get composition conflict error';
class C does R1 does R2 {
proto method foo(|$) { * }
proto method foo(|) { * }
}
my $obj = C.new;
#?rakudo 2 skip 'proto does not promote to multi'
Expand Down
2 changes: 1 addition & 1 deletion S13-overloading/typecasting-mixed.t
Expand Up @@ -8,7 +8,7 @@ plan 14;

{
class TypeCastMixed {
method &.( |$capture ) {return 'pretending to be a sub'} #OK not used
method &.( |capture ) {return 'pretending to be a sub'} #OK not used
method postcircumfix:<[ ]> (**@slice) {return 'pretending to be an array'} #OK not used
method %.{ **@slice } {return 'pretending to be a hash'} #OK not used
}
Expand Down
2 changes: 1 addition & 1 deletion S14-traits/routines.t
Expand Up @@ -55,7 +55,7 @@ plan 12;
# RT 112664
{
multi trait_mod:<is>($m, :$a!) {
multi y(|$) { my $x = $m }
multi y(|) { my $x = $m }
$m.wrap(&y)
}
sub rt112664 is a {}
Expand Down

0 comments on commit e6ba01a

Please sign in to comment.