Skip to content

Commit 287a9c5

Browse files
committed
Add tests for :basename and :dirname parameters of IO::Path.new
1 parent aa22e3b commit 287a9c5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

S32-io/io-path.t

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use v6;
22
use Test;
33

4-
plan 13;
4+
plan 15;
55

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

@@ -10,6 +10,12 @@ isa-ok $path, IO::Path, "Str.IO returns an IO::Path";
1010
is IO::Path.new('/foo/bar.txt'), $path,
1111
"Constructor works without named arguments";
1212

13+
is IO::Path.new(:basename<bar.txt>), IO::Path.new('bar.txt'),
14+
"Can use either :basename or positional argument";
15+
16+
is IO::Path.new(:dirname</foo>, :basename<bar.txt>).cleanup, $path.cleanup,
17+
"Can construct path from :dirname and :basename";
18+
1319
# This assumes slash-separated paths, so it will break on, say, VMS
1420

1521
is $path.volume, '', 'volume';

0 commit comments

Comments
 (0)