Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updates and fudges.
  • Loading branch information
colomon committed Jun 3, 2013
1 parent d3f8d74 commit 05d756b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions S32-io/dir.t
Expand Up @@ -9,10 +9,12 @@ my @files;
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';
isa_ok @files[0], IO::Path, 'dir() returns IO::Path objects';
is @files[0].directory, '.', 'dir() returns IO::Path 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';
is +dir(:test).grep('.'|'..'), 2, "... unless you override :test";
nok dir( test=> none('.', '..', 't') ).grep('t'), "can exclude t/ dir";
Expand Down
12 changes: 8 additions & 4 deletions S32-io/io-path.t
@@ -1,12 +1,14 @@
use v6;
use Test;

plan 12;
plan 11;

# L<S32::IO/IO::Path>

my $path = '/foo/bar.txt'.path;
isa_ok $path, IO::Path, "Str.path returns an IO::Path";
is IO::Path.gist, "(IO::Path)", ".gist returns the correct thing on an IO::Path type object";

is $path.volume, '', 'volume';
is $path.directory, '/foo', 'directory';
is $path.basename, 'bar.txt', 'basename';
Expand All @@ -18,7 +20,9 @@ is $path.is-absolute, True, 'is-absolute';
is $path.is-relative, False, 'is-relative';

isa_ok $path.path, IO::Path, 'IO::Path.path returns IO::Path';
#?rakudo 3 skip 'need to test OS submodules instead'
is '/'.path.Str, '/', '.path.Str roundtrips';
is '///.'.path.Str, '///.', '... even for weird cases';

# These tests aren't particularly platform independent
# is '/'.path.Str, '/', '.path.Str roundtrips';
# is '///.'.path.Str, '///.', '... even for weird cases';

is 'foo/bar'.path.Str, 'foo/bar', 'roundtrips entire path';

0 comments on commit 05d756b

Please sign in to comment.