Run `diff -u' if the test fails.
authorJim Meyering <jim@meyering.net>
Sat, 20 Nov 1999 10:46:06 +0000 (10:46 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 20 Nov 1999 10:46:06 +0000 (10:46 +0000)
tests/cp/cp-mv-backup

index 1bad6de..aaddaa2 100755 (executable)
@@ -91,9 +91,9 @@ EOF
 
 sed 's/: x/:/' $expected-tmp |cat $expected-tmp - > $expected
 
-# Uncomment this if you see a failure and want to try to diagnose it.
-#diff -u $expected $actual 1>&2
-
 cmp $expected $actual || fail=1
 
+# Uncomment this if you see a failure and want to try to diagnose it.
+test $fail = 1 && diff -u $expected $actual 1>&2
+
 exit $fail