* tests/rm/fail-eperm: Instead, simply transform the actual output diagnostic.
authorJim Meyering <jim@meyering.net>
Mon, 1 Jan 2007 09:56:01 +0000 (10:56 +0100)
committerJim Meyering <jim@meyering.net>
Mon, 1 Jan 2007 09:56:01 +0000 (10:56 +0100)
Test failure reported by Bob Proulx.

ChangeLog
tests/rm/fail-eperm

index ac66c3e..1854f81 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * tests/rm/fail-eperm: Revert last change.  The PATH=... setting
        is not honored at least on HP-UX 11.23 systems.
+       Instead, simply transform the actual output diagnostic.
+       Test failure reported by Bob Proulx.
 
 2006-12-30  Jim Meyering  <jim@meyering.net>
 
index e2ce957..8801aba 100755 (executable)
@@ -3,7 +3,7 @@
 # Ensure that rm gives the expected diagnostic when failing to remove a file
 # owned by some other user in a directory with the sticky bit set.
 
-# Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -118,11 +118,16 @@ foreach my $dir (@dir_list)
                die "$ME: command `$cmd' died with signal $sig_num\n";
              }
 
-           my $exp = "$rm: cannot remove `$target_file':";
+           my $exp = "rm: cannot remove `$target_file':";
            $line
              or die "$ME: no output from `$cmd';\n"
                . "expected something like `$exp ...'\n";
 
+           # Transform the actual diagnostic so that it starts with "rm:".
+           # Depending on your system, it might be "rm:" already, or
+           # "../../src/rm:".
+           $line =~ s,^\Q$rm\E:,rm:,;
+
            my $regex = quotemeta $exp;
            $line =~ /^$regex/
              or die "$ME: unexpected diagnostic from `$cmd';\n"