From 04ef545a102e4cb3e8dec6a2b5fecbd12e45268d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 23 Jun 2001 22:04:44 +0000 Subject: [PATCH] New msgcomm tests. --- tests/ChangeLog | 8 ++++++++ tests/Makefile.am | 3 ++- tests/msgcomm-18 | 41 +++++++++++++++++++++++++++++++++++++++++ tests/msgcomm-19 | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/msgcomm-20 | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/msgcomm-21 | 45 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 184 insertions(+), 1 deletion(-) create mode 100755 tests/msgcomm-18 create mode 100755 tests/msgcomm-19 create mode 100755 tests/msgcomm-20 create mode 100755 tests/msgcomm-21 diff --git a/tests/ChangeLog b/tests/ChangeLog index aab716297..2b6512fa8 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,11 @@ +2001-06-23 Bruno Haible + + * msgcomm-18: New file, from Karl Eichwalder with modifications. + * msgcomm-19: New file, from Karl Eichwalder with modifications. + * msgcomm-20: New file, from Karl Eichwalder with modifications. + * msgcomm-21: New file, from Karl Eichwalder with modifications. + * Makefile.am (TESTS): Add them. + 2001-06-23 Bruno Haible * msgcomm-17: New file, from Karl Eichwalder. diff --git a/tests/Makefile.am b/tests/Makefile.am index edae80955..fce856dec 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -23,7 +23,8 @@ TESTS = gettext-1 gettext-2 \ 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 \ - msgcomm-14 msgcomm-15 msgcomm-16 msgcomm-17 \ + msgcomm-14 msgcomm-15 msgcomm-16 msgcomm-17 msgcomm-18 msgcomm-19 \ + msgcomm-20 msgcomm-21 \ msgfmt-1 msgfmt-2 msgfmt-3 msgfmt-4 msgfmt-5 \ msgmerge-1 msgmerge-2 msgmerge-3 msgmerge-4 msgmerge-5 msgmerge-6 \ msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 \ diff --git a/tests/msgcomm-18 b/tests/msgcomm-18 new file mode 100755 index 000000000..aa5382cab --- /dev/null +++ b/tests/msgcomm-18 @@ -0,0 +1,41 @@ +#! /bin/sh + +# Test --more-than=0; identical message are wanted once only. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test18.in1 mcomm-test18.in2" +cat < mcomm-test18.in1 +# Sure. +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test18.in2 +# Right. +#: hunt.c:759 +msgid "1" +msgstr "1x" +EOF + +tmpfiles="$tmpfiles mcomm-test18.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 mcomm-test18.in1 mcomm-test18.in2 -o mcomm-test18.out + +tmpfiles="$tmpfiles mcomm-test18.ok" +cat << EOF > mcomm-test18.ok +# Sure. +#: first.c:123 hunt.c:759 +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test18.ok mcomm-test18.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-19 b/tests/msgcomm-19 new file mode 100755 index 000000000..65b7c62cc --- /dev/null +++ b/tests/msgcomm-19 @@ -0,0 +1,44 @@ +#! /bin/sh + +# Test --more-than=0; identical message are wanted once only. +# If the first occurrence is fuzzy, keep the fuzzy mark. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test19.in1 mcomm-test19.in2" +cat < mcomm-test19.in1 +# Not sure. +#: first.c:123 +#, fuzzy +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test19.in2 +# Sure. +#: hunt.c:759 +msgid "1" +msgstr "1x" +EOF + +tmpfiles="$tmpfiles mcomm-test19.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 mcomm-test19.in1 mcomm-test19.in2 -o mcomm-test19.out + +tmpfiles="$tmpfiles mcomm-test19.ok" +cat << EOF > mcomm-test19.ok +# Not sure. +#: first.c:123 hunt.c:759 +#, fuzzy +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test19.ok mcomm-test19.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-20 b/tests/msgcomm-20 new file mode 100755 index 000000000..0274190a4 --- /dev/null +++ b/tests/msgcomm-20 @@ -0,0 +1,44 @@ +#! /bin/sh + +# Test --more-than=0; identical message are wanted once only. +# If the first occurrence is not fuzzy, don't make the result fuzzy. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test20.in1 mcomm-test20.in2" +cat < mcomm-test20.in1 +# Sure. +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test20.in2 +# Not sure. +#: hunt.c:759 +#, fuzzy +msgid "1" +msgstr "1x" +EOF + +tmpfiles="$tmpfiles mcomm-test20.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 -o mcomm-test20.out \ + mcomm-test20.in1 mcomm-test20.in2 + +tmpfiles="$tmpfiles mcomm-test20.ok" +cat << EOF > mcomm-test20.ok +# Sure. +#: first.c:123 hunt.c:759 +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test20.ok mcomm-test20.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-21 b/tests/msgcomm-21 new file mode 100755 index 000000000..ad855442a --- /dev/null +++ b/tests/msgcomm-21 @@ -0,0 +1,45 @@ +#! /bin/sh + +# Test --more-than=0; identical message are wanted once only. +# If both occurrences are fuzzy, keep the fuzzy mark. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test21.in1 mcomm-test21.in2" +cat < mcomm-test21.in1 +# Not sure. +#: first.c:123 +#, fuzzy +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test21.in2 +# Doubt. +#: hunt.c:759 +#, fuzzy +msgid "1" +msgstr "1x" +EOF + +tmpfiles="$tmpfiles mcomm-test21.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 mcomm-test21.in1 mcomm-test21.in2 -o mcomm-test21.out + +tmpfiles="$tmpfiles mcomm-test21.ok" +cat << EOF > mcomm-test21.ok +# Not sure. +#: first.c:123 hunt.c:759 +#, fuzzy +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test21.ok mcomm-test21.out +result=$? + +rm -fr $tmpfiles + +exit $result -- 2.47.3