Don't make the success of the test depend on the
authorJim Meyering <jim@meyering.net>
Sat, 26 Feb 2000 21:34:41 +0000 (21:34 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 26 Feb 2000 21:34:41 +0000 (21:34 +0000)
order in which directory entries are processed.
Reported by Andreas Schwab.

tests/rm/r-2

index 2334f19..cd4a3ab 100755 (executable)
@@ -17,7 +17,7 @@ mkdir $tmp $tmp/a $tmp/a/b
 > $tmp/a/b/g
 
 # FIXME: if this fails, it's a framework failure
-cat <<EOF > $tmp/$test.E
+cat <<EOF | sort > $tmp/$test.E
 removing all entries of directory $tmp/a
 removing all entries of directory $tmp/a/b
 removing $tmp/a/b/g
@@ -31,8 +31,10 @@ export LANGUAGE
 LANG=C
 export LANG
 
+# Note that both the expected output (above) and the actual output lines
+# are sorted, because directory entries may be processed in arbitrary order.
 fail=0
-$RM --verbose -r $tmp/a > $tmp/$test.O || fail=1
+$RM --verbose -r $tmp/a | sort > $tmp/$test.O || fail=1
 
 if test -d $tmp/a; then
   fail=1