Skip to content

Commit

Permalink
Merge 48a7003 into 206f0cf
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonhagland committed Jul 19, 2020
2 parents 206f0cf + 48a7003 commit 534aec4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/Test/File.pm
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
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
8 changes: 5 additions & 3 deletions t/test_files.t
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 Down Expand Up @@ -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

0 comments on commit 534aec4

Please sign in to comment.