Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Test/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ sub _normalize {
sub _win32 {
return 0 if $^O eq 'darwin';
return $ENV{PRETEND_TO_BE_WIN32} if defined $ENV{PRETEND_TO_BE_WIN32};
return $^O =~ m/Win/;
return $^O =~ m/Win/ || $^O eq 'msys';
}

# returns true if symlinks can't exist
Expand Down
4 changes: 4 additions & 0 deletions t/file_contains.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ test_test();

SKIP: {
skip "Superuser has special privileges", 1, if( $> == 0 or $< == 0 );
skip "Not possible to make file unreadable on MSYS2" if $^O eq 'msys';
test_out( "not ok 1 - not_readable contains $pattern1" );
test_diag( 'File [not_readable] is not readable!' );
test_fail(+1);
Expand Down Expand Up @@ -58,6 +59,7 @@ test_test();

SKIP: {
skip "Superuser has special privileges", 1, if( $> == 0 or $< == 0 );
skip "Not possible to make file unreadable on MSYS2" if $^O eq 'msys';
test_out( "not ok 1 - not_readable doesn't contain $bad_pattern" );
test_diag( 'File [not_readable] is not readable!' );
test_fail(+1);
Expand Down Expand Up @@ -92,6 +94,7 @@ test_test();

SKIP: {
skip "Superuser has special privileges", 1, if( $> == 0 or $< == 0 );
skip "Not possible to make file unreadable on MSYS2" if $^O eq 'msys';
test_out( "not ok 1 - not_readable contains $pattern1" );
test_diag( 'File [not_readable] is not readable!' );
test_fail(+1);
Expand Down Expand Up @@ -127,6 +130,7 @@ test_test();

SKIP: {
skip "Superuser has special privileges", 1, if( $> == 0 or $< == 0 );
skip "Not possible to make file unreadable on MSYS2" if $^O eq 'msys';
test_out( "not ok 1 - not_readable doesn't contain $bad_pattern" );
test_diag( 'File [not_readable] is not readable!' );
test_fail(+1);
Expand Down
10 changes: 6 additions & 4 deletions t/test_files.t
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ subtest readable_fails => sub { SKIP: {

subtest not_readable_fails => sub { SKIP: {
skip "Superuser has special privileges", 3, if( $> == 0 or $< == 0 );
skip "Not possible to make file unreadable on MSYS2" if $^O eq 'msys';
test_out( 'ok 1 - writeable is not readable' );
file_not_readable_ok( 'writeable' );
test_out( 'ok 2 - writeable really is not readable' );
Expand All @@ -99,7 +100,7 @@ subtest writable_fails => sub {
file_writable_ok( 'writable' );
test_out( "ok 2 - $label" );
file_writable_ok( 'writable', $label );
if( $> == 0 or $< == 0 ) {
if( ($^O ne 'MSWin32') && ($> == 0 or $< == 0 )) {
test_out( 'ok 3 - readable is writeable' );
}
else {
Expand All @@ -115,6 +116,7 @@ subtest writable_fails => sub {

subtest not_writable => sub { SKIP: {
skip "Superuser has special privileges", 1, if( $> == 0 or $< == 0 );
skip "Not possible to make file unreadable on MSYS2" if $^O eq 'msys';
test_out( 'ok 1 - readable is not writable' );
test_out( 'not ok 2 - writable is not writable' );
test_diag('File [writable] is writable!');
Expand All @@ -128,9 +130,9 @@ subtest not_writable => sub { SKIP: {

subtest executable => sub {
if (Test::File::_win32()) {
test_out("ok 1 # skip file_not_executable_ok doesn't work on Windows!");
test_out("ok 2 # skip file_not_executable_ok doesn't work on Windows!");
test_out("ok 3 # skip file_not_executable_ok doesn't work on Windows!");
test_out("ok 1 # skip file_executable_ok doesn't work on Windows!");
test_out("ok 2 # skip file_executable_ok doesn't work on Windows!");
test_out("ok 3 # skip file_executable_ok doesn't work on Windows!");
}
else {
test_out("ok 1 - executable is executable");
Expand Down