}
SKIP: {
- my $skip_count = 5;
+ my $skip_count = 3;
skip "Windows will not set this error condition", $skip_count
if $^O eq 'MSWin32';
my (@created, $error);
my $user = join('_' => 'foobar', $$);
@created = mkpath($deepest, { mode => 0711, user => $user, error => \$error });
- TODO: {
- local $TODO = "Notwithstanding the phony 'user', mkpath will actually create subdirectories; should it?";
- is(scalar(@created), 0, "No subdirectories created");
- }
+# TODO: {
+# local $TODO = "Notwithstanding the phony 'user', mkpath will actually create subdirectories; should it?";
+# is(scalar(@created), 0, "No subdirectories created");
+# }
is(scalar(@$error), 1, "caught error condition" );
my ($file, $message) = each %{$error->[0]};
like($message,
my ($least_deep, $next_deepest, $deepest) =
create_3_level_subdirs( qw| b5wj8CJcc7gl XTJe2C3WGLg5 VZ_y2T0XfKu3 | );
my (@created, $error);
+ my $warn;
+ local $SIG{__WARN__} = sub { $warn = shift };
@created = mkpath($deepest, { mode => 0711, uid => $>, error => \$error });
+ SKIP: {
+ my $skip_count = 1;
+ skip "Warning should only appear on Windows", $skip_count
+ unless $^O eq 'MSWin32';
+ like($warn,
+ qr/Option\(s\) implausible on Win32 passed to mkpath\(\) or make_path\(\)/,
+ 'make_path with final hashref warned due to options implausible on Win32'
+ );
+ }
is(scalar(@created), 3, "Provide valid 'uid' argument: 3 subdirectories created");
cleanup_3_level_subdirs($least_deep);
my (@created, $error);
my $bad_group = join('_' => 'foobarbaz', $$);
@created = mkpath($deepest, { mode => 0711, group => $bad_group, error => \$error });
- TODO: {
- local $TODO = "Notwithstanding the phony 'group', mkpath will actually create subdirectories; should it?";
- is(scalar(@created), 0, "No subdirectories created");
- }
+# TODO: {
+# local $TODO = "Notwithstanding the phony 'group', mkpath will actually create subdirectories; should it?";
+# is(scalar(@created), 0, "No subdirectories created");
+# }
is(scalar(@$error), 1, "caught error condition" );
my ($file, $message) = each %{$error->[0]};
like($message,
my ($least_deep, $next_deepest, $deepest) =
create_3_level_subdirs( qw| BEcigvaBNisY rd4lJ1iZRyeS OyQnDPIBxP2K | );
my (@created, $error);
+ my $warn;
+ local $SIG{__WARN__} = sub { $warn = shift };
@created = mkpath($deepest, { mode => 0711, group => $(, error => \$error });
+ SKIP: {
+ my $skip_count = 1;
+ skip "Warning should only appear on Windows", $skip_count
+ unless $^O eq 'MSWin32';
+ like($warn,
+ qr/Option\(s\) implausible on Win32 passed to mkpath\(\) or make_path\(\)/,
+ 'make_path with final hashref warned due to options implausible on Win32'
+ );
+ }
is(scalar(@created), 3, "Provide valid 'group' argument: 3 subdirectories created");
cleanup_3_level_subdirs($least_deep);