Cygwin can delete open files, so change some workarounds we had in tests
for closing open files before deleting them that were for both MSWin32
and cygwin to be for MSWin32 only.
is ( $fc->file->{filename}, $new_fname, 'new filname matches' );
ok ( compare($new_storage, $new_source_file) == 0, 'new content matches' );
-if ($^O =~ /win32|cygwin/i) {
- close $fc->file->{handle}; # can't delete open files on Windows
+if ($^O eq 'MSWin32') {
+ close $fc->file->{handle}; # can't delete open files on Win32
}
$fc->delete;
} 'The operation failed';
}
-# otherwise can't unlink the fake db file on these systems
-$schema->storage->_dbh->disconnect if $^O =~ /MSWin32|cygwin/i;
+# otherwise can't unlink the fake db file
+$schema->storage->_dbh->disconnect if $^O eq 'MSWin32';
### Now, move the db file back to the correct name
unlink($db_orig) or die "could not delete $db_orig: $!";