doc: use ASCII in .texi files where UTF-8 isn't needed
[gnulib.git] / tests / test-init.sh
index 32b523f..be447b3 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for init.sh
-# Copyright (C) 2011 Free Software Foundation, Inc.
+# Copyright (C) 2011-2014 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -50,16 +50,21 @@ EOF
   case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
 
   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.
-  cat <<\EOF > exp
+  # Compare against expected output only if compare is using diff -u.
+  if grep @ out >/dev/null; then
+    # 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 @@
+    sed 's/    .*//;/^@@/d' out > k && mv k out
+    cat <<\EOF > exp
 --- empty
 +++ in
-@@ -0,0 +1 @@
 +xyz
 EOF
-  sed 's/      .*//' out > k && mv k out
-  compare exp out || fail=1
+    compare exp out || fail=1
+  fi
   case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
 }