diff options
author | Bruno Haible <bruno@clisp.org> | 2008-10-04 11:33:40 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:15:54 +0200 |
commit | a95484914cac0df28f230460837096ff90651a25 (patch) | |
tree | c9cedaf837ec70e5de5a90befb75413bd508cf1d /gettext-tools/tests/msgcomm-27 | |
parent | 64c4423481c92b9dafa7651b78e96ec4837f8862 (diff) | |
download | external_gettext-a95484914cac0df28f230460837096ff90651a25.zip external_gettext-a95484914cac0df28f230460837096ff90651a25.tar.gz external_gettext-a95484914cac0df28f230460837096ff90651a25.tar.bz2 |
Test the handling of 'range:' flags.
Diffstat (limited to 'gettext-tools/tests/msgcomm-27')
-rwxr-xr-x | gettext-tools/tests/msgcomm-27 | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/gettext-tools/tests/msgcomm-27 b/gettext-tools/tests/msgcomm-27 new file mode 100755 index 0000000..09d423d --- /dev/null +++ b/gettext-tools/tests/msgcomm-27 @@ -0,0 +1,99 @@ +#! /bin/sh + +# Test handling of format and 'range:' flag. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles mcomm-test27.in1 mcomm-test27.in2" +cat <<EOF > mcomm-test27.in1 +msgid "one day" +msgid_plural "%d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 1..6 +msgid "one week and one day" +msgid_plural "one week and %d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 1..7 +msgid "two weeks and one day" +msgid_plural "two weeks and %d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 0..6 +msgid "three weeks and one day" +msgid_plural "three weeks and %d days" +msgstr[0] "" +msgstr[1] "" +EOF + +cat <<EOF > mcomm-test27.in2 +#, c-format, range: 1..6 +msgid "one day" +msgid_plural "%d days" +msgstr[0] "" +msgstr[1] "" + +msgid "one week and one day" +msgid_plural "one week and %d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 0..6 +msgid "two weeks and one day" +msgid_plural "two weeks and %d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 1..7 +msgid "three weeks and one day" +msgid_plural "three weeks and %d days" +msgstr[0] "" +msgstr[1] "" +EOF + +tmpfiles="$tmpfiles mcomm-test27.tmp mcomm-test27.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} -o mcomm-test27.tmp mcomm-test27.in1 mcomm-test27.in2 +test $? = 0 || { rm -fr $tmpfiles; exit 1; } +LC_ALL=C tr -d '\r' < mcomm-test27.tmp > mcomm-test27.out +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles mcomm-test27.ok" +cat << EOF > mcomm-test27.ok +#, c-format +msgid "one day" +msgid_plural "%d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format +msgid "one week and one day" +msgid_plural "one week and %d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 0..7 +msgid "two weeks and one day" +msgid_plural "two weeks and %d days" +msgstr[0] "" +msgstr[1] "" + +#, c-format, range: 0..7 +msgid "three weeks and one day" +msgid_plural "three weeks and %d days" +msgstr[0] "" +msgstr[1] "" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test27.ok mcomm-test27.out +result=$? + +rm -fr $tmpfiles + +exit $result |