Skip to content

Commit

Permalink
[io grant] Test $*CWD in IO::Path.dir(:test) Callable
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Apr 21, 2017
1 parent 896191b commit 41b7f9f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion S32-io/dir.t
Expand Up @@ -3,7 +3,7 @@ use lib 't/spec/packages';
use Test;
use Test::Util;

plan 14;
plan 15;

# L<S32::IO/Functions/"=item dir">

Expand Down Expand Up @@ -44,4 +44,20 @@ is_run 'dir | say', {
err => rx/'Argument' .* 'say' .* 'use .say'/,
}, '`dir | say` has useful error message';

{
my $dir = make-temp-dir;
$dir.add('foo.txt').open(:w).close;
my $dir-str = $dir.absolute;

my $tested = False;
@ = dir $dir, :CWD($dir), :test{
when 'foo.txt' {
is-deeply $*CWD.absolute, $dir-str,
'$*CWD is set right inside dir(:test)';
$tested = True;
}
};
$tested or flunk 'expected a dir $*CWD test but it never ran';
}

# vim: ft=perl6

0 comments on commit 41b7f9f

Please sign in to comment.