summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2015-06-24 12:04:25 +0900
committerDaiki Ueno <ueno@gnu.org>2015-06-24 12:06:17 +0900
commit3056574daf60f3e68fbaffdb1ad6991cdc11a48b (patch)
tree4ed77b71077be769ab701f9580acface75e99aaa
parent656f1ee45975aa9a262232abc835ba118d0d98ae (diff)
downloadexternal_gettext-3056574daf60f3e68fbaffdb1ad6991cdc11a48b.zip
external_gettext-3056574daf60f3e68fbaffdb1ad6991cdc11a48b.tar.gz
external_gettext-3056574daf60f3e68fbaffdb1ad6991cdc11a48b.tar.bz2
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: <https://lists.gnu.org/archive/html/bug-gettext/2015-06/msg00019.html>.
-rw-r--r--gettext-tools/tests/ChangeLog6
-rwxr-xr-xgettext-tools/tests/msgfilter-814
2 files changed, 19 insertions, 1 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog
index 6c10a38..c02908b 100644
--- a/gettext-tools/tests/ChangeLog
+++ b/gettext-tools/tests/ChangeLog
@@ -1,5 +1,11 @@
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.
* msginit-4: Likewise.
diff --git a/gettext-tools/tests/msgfilter-8 b/gettext-tools/tests/msgfilter-8
index 49cf2c0..3ffcb5e 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