test-init.sh: accommodate Solaris 5.10's different diff -u output
authorJim Meyering <meyering@redhat.com>
Wed, 4 Jan 2012 19:19:37 +0000 (20:19 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 5 Jan 2012 14:27:38 +0000 (15:27 +0100)
* tests/test-init.sh: Also exempt @@ lines from the comparison
of diff output, since Solaris 5.10 and GNU diff formats differ.
Reported by Stefano Lattarini.

ChangeLog
tests/test-init.sh

index 0f554e6..10ddc0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-01-04  Jim Meyering  <meyering@redhat.com>
+
+       test-init.sh: accommodate Solaris 5.10's different diff -u output
+       * tests/test-init.sh: Also exempt @@ lines from the comparison
+       of diff output, since Solaris 5.10 and GNU diff formats differ.
+       Reported by Stefano Lattarini.
+
 2012-01-04  Paul Eggert  <eggert@cs.ucla.edu>
 
        test-posixtm: don't assume signed integer wraparound
index 123da8e..ee1c798 100755 (executable)
@@ -52,13 +52,15 @@ EOF
   compare empty in >out 2>err && fail=1
   # Remove the TAB-date suffix on each --- and +++ line,
   # for both the expected and the actual output files.
+  # Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ:
+  # -@@ -0,0 +1 @@
+  # +@@ -1,0 +1,1 @@
   cat <<\EOF > exp
 --- empty
 +++ in
-@@ -0,0 +1 @@
 +xyz
 EOF
-  sed 's/      .*//' out > k && mv k out
+  sed 's/      .*//;/^@@/d' out > k && mv k out
   compare exp out || fail=1
   case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
 }