Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgcat-20
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Verify --sort-by-file.
5
6 cat <<EOF > mcat-test20.in
7 #: clients/inst_language.ycp:119
8 msgid "one"
9 msgstr "1"
10
11 #: clients/inst_language.ycp:108
12 msgid ""
13 "two"
14 msgstr ""
15 "2"
16
17 #: clients/inst_language.ycp:108
18 msgid "three"
19 msgstr "3"
20
21 #: clients/inst_language.ycp:103
22 msgctxt "foo"
23 msgid "four"
24 msgstr "4"
25
26 #: clients/inst_language.ycp:103
27 msgctxt "bar"
28 msgid "four"
29 msgstr "4"
30 EOF
31
32 : ${MSGCAT=msgcat}
33 ${MSGCAT} --sort-by-file -o mcat-test20.tmp mcat-test20.in || exit 1
34 LC_ALL=C tr -d '\r' < mcat-test20.tmp > mcat-test20.out || exit 1
35
36 cat << EOF > mcat-test20.ok
37 #: clients/inst_language.ycp:103
38 msgctxt "bar"
39 msgid "four"
40 msgstr "4"
41
42 #: clients/inst_language.ycp:103
43 msgctxt "foo"
44 msgid "four"
45 msgstr "4"
46
47 #: clients/inst_language.ycp:108
48 msgid "three"
49 msgstr "3"
50
51 #: clients/inst_language.ycp:108
52 msgid "two"
53 msgstr "2"
54
55 #: clients/inst_language.ycp:119
56 msgid "one"
57 msgstr "1"
58 EOF
59
60 : ${DIFF=diff}
61 ${DIFF} mcat-test20.ok mcat-test20.out
62 result=$?
63
64 exit $result