Skip to content

Commit

Permalink
Adapt dir() tests, because now Str is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Oct 27, 2014
1 parent f4efeee commit 6396528
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions S32-io/dir.t
Expand Up @@ -11,9 +11,9 @@ ok (@files = dir()), "dir() runs in cwd()";
# see roast's README as for why there is always a t/ available
#?niecza skip "Grepping Str against a list of IO::Path does not work"
ok @files.grep('t'), 'current directory contains a t/ dir';
ok @files.grep(*.basename eq 't'), 'current directory contains a t/ dir';
isa_ok @files[0], IO::Path, 'dir() returns IO::Path objects';
is @files[0].directory, '.', 'dir() returns IO::Path object in the current directory';
ok @files.grep(*.IO.basename eq 't'), 'current directory contains a t/ dir';
isa_ok @files[0], Str, 'dir() returns strings';
is @files[0].IO.dirname, '.', 'dir() returns Str object in the current directory';

#?niecza 3 skip "Grepping Str against a list of IO::Path does not work"
nok @files.grep('.'|'..'), '"." and ".." are not returned';
Expand All @@ -22,8 +22,8 @@ nok dir( test=> none('.', '..', 't') ).grep('t'), "can exclude t/ dir";

# previous tests rewritten to not smartmatch against IO::Path.
# Niecza also seems to need the ~, alas.
nok @files.grep(*.basename eq '.'|'..'), '"." and ".." are not returned';
is +dir(:test).grep(*.basename eq '.'|'..'), 2, "... unless you override :test";
nok dir( test=> none('.', '..', 't') ).grep(*.basename eq 't'), "can exclude t/ dir";
nok @files.grep(*.IO.basename eq '.'|'..'), '"." and ".." are not returned';
is +dir(:test).grep(*.IO.basename eq '.'|'..'), 2, "... unless you override :test";
nok dir( test=> none('.', '..', 't') ).grep(*.IO.basename eq 't'), "can exclude t/ dir";

is dir('t').[0].directory, 't', 'dir("t") returns paths with .directory of "t"';
is dir('t').[0].IO.dirname, 't', 'dir("t") returns paths with .dirname of "t"';

0 comments on commit 6396528

Please sign in to comment.