Perl6-Pugs

 view release on metacpan or  search on metacpan

perl5/Pugs-Compiler-Perl6/t/05-sub.t  view on Meta::CPAN


# Checking that testing is sane: subroutines

use v6-alpha;

say '1..5';

sub ok($num) {
    say "ok $num";
}

ok(1);
ok 2;

my $counter = 2;
sub ok_auto {
    ++$counter;
    say "ok $counter";
}

ok_auto();
ok_auto;

sub run_sub(Code &code) {
    code();
}


run_sub( -> $blah {  say "ok 5"; }
       );



( run in 3.582 seconds using v1.01-cache-2.11-cpan-b301d465b3d )