Skip to content

Commit

Permalink
[io grant] Cover IO::Spec::Win32.basename
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Apr 9, 2017
1 parent cd62ff2 commit c3c51ed
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S32-io/io-spec-win.t
Expand Up @@ -2,7 +2,7 @@ use v6;
use Test;
# L<S32::IO/IO::Spec>

plan 209;
plan 210;
my $win32 = IO::Spec::Win32;

my @canonpath =
Expand Down Expand Up @@ -300,3 +300,15 @@ else {
is $*SPEC.rootdir, '\\', 'rootdir is "\\"';
ok {.IO.d && .IO.w}.($*SPEC.tmpdir), "tmpdir: {$*SPEC.tmpdir} is a writable directory";
}

subtest '.basename' => {
my @tests = '' => '', '.' => '.', '/' => '', 'foo/' => '', '/.' => '.',
'foo/.' => '.', 'foo/..' => '..', 'foo/...' => '...',
'bar/♥foo' => '♥foo', '♥foo' => '♥foo', '♥foo/..' => '..',
'//server/share' => 'share', '//server/share/' => '';

plan +@tests;
for @tests -> (:key($in), :value($out)) {
is-deeply IO::Spec::Win32.basename($in), $out, $in;
}
}

0 comments on commit c3c51ed

Please sign in to comment.