]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Don't rely on echo -n
authorDaiki Ueno <ueno@gnu.org>
Wed, 24 Jun 2015 03:04:25 +0000 (12:04 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 24 Jun 2015 03:06:17 +0000 (12:06 +0900)
* gettext-tools/tests/msgfilter-8: Port the "echo -n" equivalent from gettext-2.
Reported by paul zimmermann in:
<https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00019.html>.

gettext-tools/tests/ChangeLog
gettext-tools/tests/msgfilter-8

index 6c10a382b83cf47e32318cb592a3a26a0becc38c..c02908bc81ddaee1fdd2c21b5378dd03b01f6d87 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-24  Daiki Ueno  <ueno@gnu.org>
+
+       * msgfilter-8: Port the "echo -n" equivalent from gettext-2.
+       Reported by paul zimmermann in:
+       <https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00019.html>.
+
 2015-06-24  Daiki Ueno  <ueno@gnu.org>
 
        * cldr-plurals-1: Skip if XML is not supported.
index 49cf2c0fdc6aa68823254f2925aa6cb8077e96f9..3ffcb5e2f0128f1316c84a6ee0982831895ced1b 100755 (executable)
@@ -3,6 +3,18 @@
 
 # Test --newline option.
 
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='        '
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
 cat <<\EOF > mfi-test8.po
 # HEADER.
 #
@@ -57,7 +69,7 @@ cat <<\EOF > filter.sh
 #!/bin/sh
 cat
 if test "$MSGFILTER_MSGID" = "the excitement of a love affair"; then
-  echo -n non-terminated line
+  echo $ac_n "non-terminated line$ac_c"
 else
   echo terminated line
 fi