4af252bf726037abd02875be6f8fce9822f61af4
[platform/upstream/gettext.git] / gettext-tools / tests / msgcat-10
1 #! /bin/sh
2
3 # Verify msgcat of two files, when the header entries have different comments
4 # but the same contents. The resulting header entry is not marked fuzzy,
5 # because the #-#-#-#-# are only in comments and do not necessarily require
6 # translator attention; in other words, an msgstr which is valid in both input
7 # files is also valid in the result.
8
9 tmpfiles=""
10 trap 'rm -fr $tmpfiles' 1 2 3 15
11
12 tmpfiles="$tmpfiles mcat-test10.in1 mcat-test10.in2"
13 cat <<\EOF > mcat-test10.in1
14 # German message file for xyz.
15 # Copyright (C) 1999, 2000, 2001 xyz.
16 # Kab Def <ke@zzz.uucp>, 2000.
17 # Def Kab <dk@zzz.uucp>, 2001.
18 #
19 msgid ""
20 msgstr ""
21 "Project-Id-Version: xyz\n"
22 "POT-Creation-Date: 2001-11-11 12:51:34+0200\n"
23 "PO-Revision-Date: 2001-11-11 13:02+02:00\n"
24 "Last-Translator: Kab Def <ke@zzz.uucp>\n"
25 "Language-Team: German <i18n@zzz.uucp>\n"
26 "MIME-Version: 1.0\n"
27 "Content-Type: text/plain; charset=ISO-8859-1\n"
28 "Content-Transfer-Encoding: 8bit\n"
29
30 #. Help text (HTML-like) START
31 #: clients/inst_ask_config.ycp:119
32 msgid ""
33 "Congratulations!"
34 msgstr ""
35 "Glückwunsch!"
36 EOF
37
38 cat <<\EOF > mcat-test10.in2
39 # German message file for xyz.
40 # Copyright (C) 1999, 2000, 2001 xyz.
41 # Kab Def <ke@zzz.uucp>, 2000.
42 #
43 msgid ""
44 msgstr ""
45 "Project-Id-Version: xyz\n"
46 "POT-Creation-Date: 2001-11-11 12:51:34+0200\n"
47 "PO-Revision-Date: 2001-11-11 13:02+02:00\n"
48 "Last-Translator: Kab Def <ke@zzz.uucp>\n"
49 "Language-Team: German <i18n@zzz.uucp>\n"
50 "MIME-Version: 1.0\n"
51 "Content-Type: text/plain; charset=ISO-8859-1\n"
52 "Content-Transfer-Encoding: 8bit\n"
53
54 #. Help text (HTML-like) START
55 #: clients/inst_ask_config.ycp:119
56 msgid ""
57 "Congratulations!"
58 msgstr ""
59 "Glückwunsch!"
60 EOF
61
62 tmpfiles="$tmpfiles mcat-test10.tmp mcat-test10.out"
63 rm -f mcat-test10.tmp
64
65 : ${MSGCAT=msgcat}
66 ${MSGCAT} --more-than=0 -o mcat-test10.tmp \
67     mcat-test10.in1 mcat-test10.in2
68 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
69 LC_ALL=C tr -d '\r' < mcat-test10.tmp > mcat-test10.out
70 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
71
72 tmpfiles="$tmpfiles mcat-test10.ok"
73 cat <<\EOF > mcat-test10.ok
74 # #-#-#-#-#  mcat-test10.in1 (xyz)  #-#-#-#-#
75 # German message file for xyz.
76 # Copyright (C) 1999, 2000, 2001 xyz.
77 # Kab Def <ke@zzz.uucp>, 2000.
78 # Def Kab <dk@zzz.uucp>, 2001.
79 #
80 # #-#-#-#-#  mcat-test10.in2 (xyz)  #-#-#-#-#
81 # German message file for xyz.
82 # Copyright (C) 1999, 2000, 2001 xyz.
83 # Kab Def <ke@zzz.uucp>, 2000.
84 #
85 msgid ""
86 msgstr ""
87 "Project-Id-Version: xyz\n"
88 "POT-Creation-Date: 2001-11-11 12:51:34+0200\n"
89 "PO-Revision-Date: 2001-11-11 13:02+02:00\n"
90 "Last-Translator: Kab Def <ke@zzz.uucp>\n"
91 "Language-Team: German <i18n@zzz.uucp>\n"
92 "MIME-Version: 1.0\n"
93 "Content-Type: text/plain; charset=ISO-8859-1\n"
94 "Content-Transfer-Encoding: 8bit\n"
95
96 #. Help text (HTML-like) START
97 #: clients/inst_ask_config.ycp:119
98 msgid "Congratulations!"
99 msgstr "Glückwunsch!"
100 EOF
101
102 : ${DIFF=diff}
103 ${DIFF} mcat-test10.ok mcat-test10.out
104 result=$?
105
106 rm -fr $tmpfiles
107
108 exit $result