diff options
author | Daiki Ueno <ueno@gnu.org> | 2014-12-09 13:45:45 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2014-12-09 13:46:22 +0900 |
commit | 2d5afe11ee5ea51937e3047663d7f1a80e191bfd (patch) | |
tree | b213854a883020b842d5ef683fd5beb9a1b37545 /gettext-tools | |
parent | 64d460e5ead697f935eea61432a04e52894eb608 (diff) | |
download | external_gettext-2d5afe11ee5ea51937e3047663d7f1a80e191bfd.zip external_gettext-2d5afe11ee5ea51937e3047663d7f1a80e191bfd.tar.gz external_gettext-2d5afe11ee5ea51937e3047663d7f1a80e191bfd.tar.bz2 |
tests: Test msgcat --sort-by-file option
* msgcat-20: New file.
* Makefile.am (TESTS): Add new test.
Diffstat (limited to 'gettext-tools')
-rw-r--r-- | gettext-tools/tests/ChangeLog | 6 | ||||
-rw-r--r-- | gettext-tools/tests/Makefile.am | 2 | ||||
-rwxr-xr-x | gettext-tools/tests/msgcat-20 | 64 |
3 files changed, 71 insertions, 1 deletions
diff --git a/gettext-tools/tests/ChangeLog b/gettext-tools/tests/ChangeLog index e518f90..cf95e07 100644 --- a/gettext-tools/tests/ChangeLog +++ b/gettext-tools/tests/ChangeLog @@ -1,5 +1,11 @@ 2014-12-09 Daiki Ueno <ueno@gnu.org> + tests: Test msgcat --sort-by-file option + * msgcat-20: New file. + * Makefile.am (TESTS): Add new test. + +2014-12-09 Daiki Ueno <ueno@gnu.org> + tests: Improve test coverage of Lua scanner * xgettext-lua-1: Test nested and unmatched brackets. diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index 757468a..5a0d3c0 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -29,7 +29,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \ msgattrib-properties-1 \ msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \ msgcat-8 msgcat-9 msgcat-10 msgcat-11 msgcat-12 msgcat-13 msgcat-14 \ - msgcat-15 msgcat-16 msgcat-17 msgcat-18 msgcat-19 \ + msgcat-15 msgcat-16 msgcat-17 msgcat-18 msgcat-19 msgcat-20 \ msgcat-properties-1 msgcat-properties-2 \ msgcat-stringtable-1 \ msgcmp-1 msgcmp-2 msgcmp-3 msgcmp-4 \ diff --git a/gettext-tools/tests/msgcat-20 b/gettext-tools/tests/msgcat-20 new file mode 100755 index 0000000..2960fb6 --- /dev/null +++ b/gettext-tools/tests/msgcat-20 @@ -0,0 +1,64 @@ +#! /bin/sh +. "${srcdir=.}/init.sh"; path_prepend_ . ../src + +# Verify --sort-by-file. + +cat <<EOF > mcat-test20.in +#: clients/inst_language.ycp:119 +msgid "one" +msgstr "1" + +#: clients/inst_language.ycp:108 +msgid "" +"two" +msgstr "" +"2" + +#: clients/inst_language.ycp:108 +msgid "three" +msgstr "3" + +#: clients/inst_language.ycp:103 +msgctxt "foo" +msgid "four" +msgstr "4" + +#: clients/inst_language.ycp:103 +msgctxt "bar" +msgid "four" +msgstr "4" +EOF + +: ${MSGCAT=msgcat} +${MSGCAT} --sort-by-file -o mcat-test20.tmp mcat-test20.in || exit 1 +LC_ALL=C tr -d '\r' < mcat-test20.tmp > mcat-test20.out || exit 1 + +cat << EOF > mcat-test20.ok +#: clients/inst_language.ycp:103 +msgctxt "bar" +msgid "four" +msgstr "4" + +#: clients/inst_language.ycp:103 +msgctxt "foo" +msgid "four" +msgstr "4" + +#: clients/inst_language.ycp:108 +msgid "three" +msgstr "3" + +#: clients/inst_language.ycp:108 +msgid "two" +msgstr "2" + +#: clients/inst_language.ycp:119 +msgid "one" +msgstr "1" +EOF + +: ${DIFF=diff} +${DIFF} mcat-test20.ok mcat-test20.out +result=$? + +exit $result |