From: Daiki Ueno Date: Wed, 24 Jun 2015 03:04:25 +0000 (+0900) Subject: tests: Don't rely on echo -n X-Git-Tag: v0.19.5~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3056574daf60f3e68fbaffdb1ad6991cdc11a48b;p=thirdparty%2Fgettext.git tests: Don't rely on echo -n * gettext-tools/tests/msgfilter-8: Port the "echo -n" equivalent from gettext-2. Reported by paul zimmermann in: . --- diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index 6c10a382b..c02908bc8 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,3 +1,9 @@ +2015-06-24 Daiki Ueno + + * msgfilter-8: Port the "echo -n" equivalent from gettext-2. + Reported by paul zimmermann in: + . + 2015-06-24 Daiki Ueno * cldr-plurals-1: Skip if XML is not supported. diff --git a/gettext-tools/tests/msgfilter-8 b/gettext-tools/tests/msgfilter-8 index 49cf2c0fd..3ffcb5e2f 100755 --- a/gettext-tools/tests/msgfilter-8 +++ b/gettext-tools/tests/msgfilter-8 @@ -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