Skip to content

Commit 7428736

Browse files
committed
.absolute on paths starting with - does not produce empty string
RT#128840: https://rt.perl.org/Public/Bug/Display.html?id=128840
1 parent 71aab20 commit 7428736

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

S32-io/io-path-cygwin.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22
use Test;
33
# L<S32::IO/IO::Path>
44

5-
plan 51;
5+
plan 52;
66

77
# Make sure we have a controlled environment
88
my $*SPEC = IO::Spec::Cygwin;
@@ -82,3 +82,7 @@ is $numfile.succ.succ, "foo/file03.txt", "succ x 2";
8282
is $numfile.pred, "foo/file00.txt", "pred basic";
8383
is IO::Path::Unix.new("foo/()").succ, "foo/()", "succ only effects basename";
8484
is IO::Path::Unix.new("foo/()").succ, "foo/()", "pred only effects basename";
85+
86+
# RT#128840
87+
isnt IO::Path::Cygwin.new('-a').absolute, '',
88+
'.absolute on paths starting with `-` does not produce empty string';

S32-io/io-path-unix.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22
use Test;
33
# L<S32::IO/IO::Path>
44

5-
plan 36;
5+
plan 37;
66

77
# make sure we have a controlled environment here
88
my $*SPEC = IO::Spec::Unix;
@@ -66,3 +66,7 @@ is $numfile.succ.succ, "foo/file03.txt", "succ x 2";
6666
is $numfile.pred, "foo/file00.txt", "pred basic";
6767
is IO::Path::Unix.new("foo/()").succ, "foo/()", "succ only effects basename";
6868
is IO::Path::Unix.new("foo/()").succ, "foo/()", "pred only effects basename";
69+
70+
# RT#128840
71+
isnt IO::Path::Unix.new("-a").absolute, '',
72+
'.absolute on paths starting with `-` does not produce empty string';

S32-io/io-path-win.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22
use Test;
33
# L<S32::IO/IO::Path>
44

5-
plan 50;
5+
plan 51;
66

77
my $*SPEC = IO::Spec::Win32; # .IO needs to have IO::Spec::Win32
88
my $*CWD = 'C:\\zip\\loc'.IO;
@@ -81,3 +81,7 @@ is $numfile.succ.succ, "foo\\file03.txt", "succ x 2";
8181
is $numfile.pred, "foo\\file00.txt", "pred basic";
8282
is IO::Path::Win32.new("foo\\()").succ, "foo\\()", "succ only effects basename";
8383
is IO::Path::Win32.new("foo\\()").succ, "foo\\()", "pred only effects basename";
84+
85+
# RT#128840
86+
isnt IO::Path::Win32.new('-a').absolute, '',
87+
'.absolute on paths starting with `-` does not produce empty string';

0 commit comments

Comments
 (0)