From: Bruno Haible Date: Wed, 31 Oct 2001 19:01:32 +0000 (+0000) Subject: Extra tests from Karl Eichwalder. X-Git-Tag: v0.11~363 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21abeae727fa3cdd8879d0e5e8d38c081e474e30;p=thirdparty%2Fgettext.git Extra tests from Karl Eichwalder. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 07096e644..3e6ccb195 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,16 @@ +2001-10-31 Bruno Haible + + * Makefile.am (TESTS): Add msgcat-2, msgcat-3, msgcat-4, msgcat-5, + msgcat-6. + +2001-07-31 Karl Eichwalder + + * msgcat-2: New file. + * msgcat-3: New file. + * msgcat-4: New file. + * msgcat-5: New file. + * msgcat-6: New file. + 2001-10-31 Bruno Haible * xgettext-13: Hide warning. diff --git a/tests/Makefile.am b/tests/Makefile.am index e28db07bd..27abbabf3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,7 +20,7 @@ AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies TESTS = gettext-1 gettext-2 \ - msgcat-1 \ + msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 \ msgcmp-1 msgcmp-2 \ msgcomm-1 msgcomm-2 msgcomm-3 msgcomm-4 msgcomm-5 msgcomm-6 msgcomm-7 \ msgcomm-8 msgcomm-9 msgcomm-10 msgcomm-11 msgcomm-12 msgcomm-13 \ diff --git a/tests/msgcat-2 b/tests/msgcat-2 new file mode 100755 index 000000000..7b215748d --- /dev/null +++ b/tests/msgcat-2 @@ -0,0 +1,100 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# input files with different charsets. + +tmpfiles="mcat-test2.in1 mcat-test2.in2" +cat < mcat-test2.in1 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Glückwunsch!" +EOF + +cat < mcat-test2.in2 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +#, ycp-format +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +tmpfiles="$tmpfiles mcat-test2.out" +rm -f mcat-test2.out + +: ${MSGCAT=msgcat} +LC_MESSAGES=C LC_ALL= \ +${MSGCAT} --more-than=0 -o mcat-test2.out \ + mcat-test2.in1 mcat-test2.in2 2>&1 \ + | grep -v 'warning: .* encodings' | grep -v '^ ' + +tmpfiles="$tmpfiles mcat-test2.ok" +cat << EOF > mcat-test2.ok +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "Congratulations!" +msgstr "Glückwunsch!" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +#, ycp-format +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +: ${DIFF=diff} +${DIFF} mcat-test2.ok mcat-test2.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcat-3 b/tests/msgcat-3 new file mode 100755 index 000000000..33dbd8bc0 --- /dev/null +++ b/tests/msgcat-3 @@ -0,0 +1,101 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# input files with different charsets. +# 1. ISO-8859-1, 2. UTF-8; plus --use-first + +tmpfiles="mcat-test3.in1 mcat-test3.in2" +cat < mcat-test3.in1 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Glückwunsch!" +EOF + +cat < mcat-test3.in2 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +#, ycp-format +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +tmpfiles="$tmpfiles mcat-test3.out" +rm -f mcat-test3.out + +: ${MSGCAT=msgcat} +LC_MESSAGES=C LC_ALL= \ +${MSGCAT} --use-first --more-than=0 -o mcat-test3.out \ + mcat-test3.in1 mcat-test3.in2 2>&1 \ + | grep -v 'warning: .* encodings' | grep -v '^ ' + +tmpfiles="$tmpfiles mcat-test3.ok" +cat << EOF > mcat-test3.ok +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "Congratulations!" +msgstr "Glückwunsch!" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +#, ycp-format +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +: ${DIFF=diff} +${DIFF} mcat-test3.ok mcat-test3.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcat-4 b/tests/msgcat-4 new file mode 100755 index 000000000..697eee404 --- /dev/null +++ b/tests/msgcat-4 @@ -0,0 +1,100 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# input files with different charsets: +# 1. UTF-8, 2. ISO-8859-1; plus --use-first + +tmpfiles="mcat-test4.in1 mcat-test4.in2" +cat < mcat-test4.in1 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +#, ycp-format +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +cat < mcat-test4.in2 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Glückwunsch!" +EOF + +tmpfiles="$tmpfiles mcat-test4.out" +rm -f mcat-test4.out + +: ${MSGCAT=msgcat} +LC_MESSAGES=C LC_ALL= \ +${MSGCAT} --use-first --more-than=0 -o mcat-test4.out \ + mcat-test4.in1 mcat-test4.in2 2>&1 \ + | grep -v 'warning: .* encodings' | grep -v '^ ' + +tmpfiles="$tmpfiles mcat-test4.ok" +cat << EOF > mcat-test4.ok +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "Congratulations!" +msgstr "Glückwunsch!" +EOF + +: ${DIFF=diff} +${DIFF} mcat-test4.ok mcat-test4.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcat-5 b/tests/msgcat-5 new file mode 100755 index 000000000..1b935615c --- /dev/null +++ b/tests/msgcat-5 @@ -0,0 +1,94 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# input files with different translations: +# try --use-first + +tmpfiles="mcat-test5.in1 mcat-test5.in2" +cat < mcat-test5.in1 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Glückwunsch!" +EOF + +cat < mcat-test5.in2 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Herzlichen Glückwunsch!" +EOF + +tmpfiles="$tmpfiles mcat-test5.out" +rm -f mcat-test5.out + +: ${MSGCAT=msgcat} +${MSGCAT} --use-first --more-than=0 -o mcat-test5.out \ + mcat-test5.in1 mcat-test5.in2 + +tmpfiles="$tmpfiles mcat-test5.ok" +cat << EOF > mcat-test5.ok +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "Congratulations!" +msgstr "Glückwunsch!" +EOF + +: ${DIFF=diff} +${DIFF} mcat-test5.ok mcat-test5.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcat-6 b/tests/msgcat-6 new file mode 100755 index 000000000..439cca002 --- /dev/null +++ b/tests/msgcat-6 @@ -0,0 +1,108 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# input files with different translations: +# preserve all variants, add markers + +tmpfiles="mcat-test6.in1 mcat-test6.in2" +cat < mcat-test6.in1 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Glückwunsch!" +EOF + +cat < mcat-test6.in2 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Herzlichen Glückwunsch!" +EOF + +tmpfiles="$tmpfiles mcat-test6.out" +rm -f mcat-test6.out + +: ${MSGCAT=msgcat} +${MSGCAT} --more-than=0 -o mcat-test6.out \ + mcat-test6.in1 mcat-test6.in2 + +tmpfiles="$tmpfiles mcat-test6.ok" +cat << EOF > mcat-test6.ok +# #-#-#-#-# mcat-test6.in1 (xyz) #-#-#-#-# +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +# #-#-#-#-# mcat-test6.in2 (xyz) #-#-#-#-# +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. #-#-#-#-# mcat-test6.in1 (xyz) #-#-#-#-# +#. Help text (HTML-like) START +#. #-#-#-#-# mcat-test6.in2 (xyz) #-#-#-#-# +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +#, fuzzy +msgid "Congratulations!" +msgstr "" +"#-#-#-#-# mcat-test6.in1 (xyz) #-#-#-#-#\n" +"Glückwunsch!\n" +"#-#-#-#-# mcat-test6.in2 (xyz) #-#-#-#-#\n" +"Herzlichen Glückwunsch!" +EOF + +: ${DIFF=diff} +${DIFF} mcat-test6.ok mcat-test6.out +result=$? + +rm -fr $tmpfiles + +exit $result