+2008-11-28 Karl Berry <karl@tug.org>
+
+ * Makefile.am (TESTS): add it.
+ * last-1: new test.
+
2006-08-23 Bruno Haible <bruno@clisp.org>
* greeting-1: Remove locale setting. This test must work in all
* testdata: Copied from `../src/'.
-Copyright (C) 1996, 1997, 2001, 2006 Free Software Foundation, Inc.
+Copyright 1996, 1997, 2001, 2006, 2008 Free Software Foundation, Inc.
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-TESTS = greeting-1 greeting-2 hello-1 traditional-1
+TESTS = greeting-1 greeting-2 hello-1 last-1 traditional-1
EXTRA_DIST = $(TESTS)
+#! /bin/sh
+# Test that last greeting option specified is what counts.
+#
+# Copyright 2008 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# are permitted in any medium without royalty provided the copyright
+# notice and this notice are preserved.
+# This script takes one argument.
+
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+# We force the C locale here, since we are checking normal output,
+# which will be translated.
+
+LANGUAGE=
+LC_ALL=C
+LC_MESSAGES=
+LANG=
+export LANGUAGE LC_ALL LC_MESSAGES LANG
+
+tmpfiles="last-test1.ok"
+cat <<EOF > last-test1.ok
+my hello
+EOF
+
+tmpfiles="$tmpfiles last-test1.out"
+: ${HELLO=hello}
+${HELLO} -t -n -g 'my hello' | tr -d '\r' \
+| tr -d '\r' >last-test1.out
+
+: ${DIFF=diff}
+${DIFF} last-test1.ok last-test1.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result