Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some tests that Niecza can pass.
  • Loading branch information
colomon committed Jun 4, 2013
1 parent 05d756b commit d0a1b09
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion S32-io/dir.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 8;
plan 12;

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

Expand All @@ -11,6 +11,7 @@ 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';

Expand All @@ -19,6 +20,12 @@ nok @files.grep('.'|'..'), '"." and ".." are not returned';
is +dir(:test).grep('.'|'..'), 2, "... unless you override :test";
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";

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


0 comments on commit d0a1b09

Please sign in to comment.