changeset 20598:e57e2da803aa

solaris: diff -u emits "No differences encountered" Solaris diff -u isn't silent when two files are identical, and tests that don't account for that will fail. Fix those tests, and introduce a check that prevents reintroduction.
author Danek Duvall <danek.duvall@oracle.com>
date Wed, 19 Feb 2014 13:46:49 -0800
parents 9155257e6330
children dad29624b056
files contrib/check-code.py tests/test-convert-bzr.t tests/test-highlight.t
diffstat 3 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/check-code.py	Fri Feb 14 00:34:20 2014 +0100
+++ b/contrib/check-code.py	Wed Feb 19 13:46:49 2014 -0800
@@ -121,6 +121,7 @@
     (r'^( *)\t', "don't use tabs to indent"),
     (r'sed (-e )?\'(\d+|/[^/]*/)i(?!\\\n)',
      "put a backslash-escaped newline after sed 'i' command"),
+    (r'^diff *-\w*u.*$\n(^  \$ |^$)', "prefix diff -u with cmp"),
   ],
   # warnings
   [
--- a/tests/test-convert-bzr.t	Fri Feb 14 00:34:20 2014 +0100
+++ b/tests/test-convert-bzr.t	Wed Feb 19 13:46:49 2014 -0800
@@ -102,7 +102,7 @@
   >   > ../bzr-timestamps
   $ cd ..
   $ hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
-  $ diff -u bzr-timestamps hg-timestamps
+  $ cmp bzr-timestamps hg-timestamps || diff -u bzr-timestamps hg-timestamps
   $ cd ..
 
 merge
--- a/tests/test-highlight.t	Fri Feb 14 00:34:20 2014 +0100
+++ b/tests/test-highlight.t	Wed Feb 19 13:46:49 2014 -0800
@@ -522,7 +522,7 @@
   $ echo "" >> b
   $ echo "" >> b
   $ echo "" >> b
-  $ diff -u b a
+  $ cmp b a || diff -u b a
 
 hgweb filerevision, raw
 
@@ -531,7 +531,7 @@
   $ echo "200 Script output follows" > b
   $ echo "" >> b
   $ hg cat primes.py >> b
-  $ diff -u b a
+  $ cmp b a || diff -u b a
 
 hgweb highlightcss friendly