From 58fa199a752913dfb0455ac1397e897afcc1f9b4 Mon Sep 17 00:00:00 2001
From: James E Keenan <jkeenan@cpan.org>
Date: Thu, 11 May 2017 04:23:40 -0400
Subject: [PATCH] Correct the order of tests of chmod(). (#294)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Per code review by haarg, the order of tests was wrong in the first place.
Hence, correctly re-ordering them is a better repair than changing one test's
description.
For: https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/294
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
t/eu_command.t | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/t/eu_command.t b/t/eu_command.t
index 269aa5c..32a6f59 100644
--- a/t/eu_command.t
+++ b/t/eu_command.t
@@ -151,20 +151,21 @@ BEGIN {
is( ((stat('testdir'))[2] & 07777) & 0700,
0100, 'change a dir to execute-only' );
- # change a dir to read-only
- @ARGV = ( '0400', 'testdir' );
+ # change a dir to write-only
+ @ARGV = ( '0200', 'testdir' );
ExtUtils::Command::chmod();
is( ((stat('testdir'))[2] & 07777) & 0700,
- 0400, 'change a dir to read-only' );
+ 0200, 'change a dir to write-only' );
- # change a dir to write-only
- @ARGV = ( '0200', 'testdir' );
+ # change a dir to read-only
+ @ARGV = ( '0400', 'testdir' );
ExtUtils::Command::chmod();
is( ((stat('testdir'))[2] & 07777) & 0700,
- 0200, 'change a dir to write-only' );
+ 0400, 'change a dir to read-only' );
+ # remove the dir we've been playing with
@ARGV = ('testdir');
rm_rf;
ok( ! -e 'testdir', 'rm_rf can delete a read-only dir' );
--
2.9.4