diff options
author | Russ Allbery <rra@cpan.org> | 2021-09-12 11:39:48 -0700 |
---|---|---|
committer | Russ Allbery <rra@cpan.org> | 2021-09-12 11:41:27 -0700 |
commit | dc9ba8b08b01c3793121d11748714fdd4fd3b3d6 (patch) | |
tree | d0b359ab0ab55cef33b339e512da8b97e9b3501f /t | |
parent | 42aa105064abf78d00c977a5fe6410b985492d68 (diff) |
chmod copies of test files before modifying them
The test suite uses File::Copy::Recursive to copy test files and
then make some modifications, but the distribution may be
read-only and that module copies file modes. Explicitly chmod our
copies before updating them.
Diffstat (limited to 't')
-rwxr-xr-x | t/cli/spin.t | 1 | ||||
-rwxr-xr-x | t/spin/tree.t | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/t/cli/spin.t b/t/cli/spin.t index 0064169..434cbb5 100755 --- a/t/cli/spin.t +++ b/t/cli/spin.t @@ -61,6 +61,7 @@ my $rpod_path = File::Spec->catfile( $indir->dirname, 'software', 'docknot', 'api', 'app-docknot.rpod', ); +chmod(0644, $rpod_path); open(my $fh, '>', $rpod_path); print {$fh} "$rpod_source\n" or die "Cannot write to $rpod_path: $!\n"; close($fh); diff --git a/t/spin/tree.t b/t/spin/tree.t index d8be132..a88d0d0 100755 --- a/t/spin/tree.t +++ b/t/spin/tree.t @@ -77,6 +77,7 @@ my $rpod_path = File::Spec->catfile( $tmpdir->dirname, 'software', 'docknot', 'api', 'app-docknot.rpod', ); +chmod(0644, $rpod_path); open(my $fh, '>', $rpod_path); print {$fh} "$rpod_source\n" or die "Cannot write to $rpod_path: $!\n"; close($fh); @@ -162,6 +163,7 @@ my $versions_path = File::Spec->catfile($tmpdir->dirname, '.versions'); my $versions = slurp($versions_path); my $new_date = strftime('%Y-%m-%d %T', localtime(time() + 10)); $versions =~ s{ \d{4}-\d\d-\d\d [ ] [\d:]+ }{$new_date}xms; +chmod(0644, $versions_path); open(my $versions_fh, '>', $versions_path); print {$versions_fh} $versions or die "Cannot write to $versions_path: $!\n"; close($versions_fh); |