Help language development. Donate to The Perl Foundation

FileSystem::Parent cpan:LEMBARK last updated on 2019-08-10

t/10-wanted-d.t
use v6.d;
use lib $*PROGRAM.parent(2).add( 'lib' ).absolute;

use Test;
use FileSystem::Parent;

# $pass0 && $pass1 are Seq.

my $from    = $*PROGRAM-NAME.IO;

sub pass1
(
    IO:D $path --> Bool
)
{
    True
}

my $pass2   := &pass1;
my $pass3   := -> IO:D $path { True };

ok &pass1   , 'sub defined';
ok $pass2   , 'subref defined';
ok $pass3   , 'block defined';

ok  pass1( $from ), 'Calling sub.';
ok $pass2( $from ), 'Calling subref';
ok $pass2( $from ), 'Calling block';

done-testing;