Don't assume that the chmod will always work.
authorNicholas Clark <nick@ccl4.org>
Mon, 22 Mar 2004 21:05:09 +0000 (21:05 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 22 Mar 2004 21:05:09 +0000 (21:05 +0000)
(It won't for files on *BSD where chflags has set uchg, which is
what the OS X perforce client does)

p4raw-id: //depot/perl@22559

t/op/filetest.t

index d0ca69a..271c4f0 100755 (executable)
@@ -19,8 +19,8 @@ ok( !-d 'TEST' );
 ok( -r 'TEST' );
 
 # make sure TEST is r-x
-eval { chmod 0555, 'TEST' };
-$bad_chmod = $@;
+eval { chmod 0555, 'TEST' or die "chmod 0555, 'TEST' failed: $!" };
+chomp ($bad_chmod = $@);
 
 $oldeuid = $>;         # root can read and write anything
 eval '$> = 1';         # so switch uid (may not be implemented)
@@ -35,7 +35,7 @@ SKIP: {
        skip('we cannot chmod symlinks');
     }
     elsif ($bad_chmod) {
-       skip( $@ );
+       skip( $bad_chmod );
     }
     else {
        ok( !-w 'TEST' );