Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgexec-2
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test the builtin command "0".
5
6 # Find a 'tr' program that supports NUL bytes in the input.
7 # Solaris /usr/bin/tr does not.
8 if test -f /usr/xpg6/bin/tr; then
9   TR=/usr/xpg6/bin/tr
10 else
11   if test -f /usr/xpg4/bin/tr; then
12     TR=/usr/xpg4/bin/tr
13   else
14     TR=tr
15   fi
16 fi
17
18 cat <<\EOF > mex-test2.po
19 # HEADER.
20 #
21 msgid ""
22 msgstr ""
23 "Project-Id-Version: Bonnie Tyler\n"
24 "Content-Type: text/plain; charset=ISO-8859-1\n"
25 "Content-Transfer-Encoding: 8bit\n"
26
27 #: married-men:4
28 #, fuzzy
29 msgid "The world is full of married men"
30 msgstr "So viele verheiratete Männer"
31
32 #: married-men:5
33 msgid "with wives who never understand"
34 msgstr "und ihre Frauen verstehen sie nicht"
35
36 #: married-men:6
37 msgid "They're looking for someone to share"
38 msgstr ""
39
40 # schwer zu übersetzen...
41 #: married-men:7
42 msgid "the excitement of a love affair"
43 msgstr ""
44
45 #: married-men:8
46 msgid "Just as soon as they find you"
47 msgstr ""
48
49 #: married-men:9
50 msgid "They warn you and darn you"
51 msgstr ""
52
53 #~ msgid "You fly on the wings of romance"
54 #~ msgstr "Die Flügel der frischen Liebe\n"
55 #~ "heben dich zum Himmel"
56
57 #, fuzzy
58 #~ msgid "In the eyes of the world"
59 #~ msgstr "Für die anderen"
60
61 # Etwas freie Übersetzung.
62 #~ msgid "You're just another crazy girl"
63 #~ msgstr "bist du bloß ein verrücktes dummes Ding"
64
65 #~ msgid "Who loves a married man"
66 #~ msgstr "das einen verheirateten Mann liebt"
67 EOF
68
69 : ${MSGEXEC=msgexec}
70 LC_ALL=C \
71 ${MSGEXEC} -i mex-test2.po 0 > mex-test2.tmp 2> mex-test2.err
72 result=$?
73 cat mex-test2.err | grep -v 'warning: Locale charset' | grep -v '^ '
74 test $result = 0 || { exit 1; }
75 LC_ALL=C $TR -d '\r' < mex-test2.tmp > mex-test2.out || exit 1
76
77 : ${CMP=cmp}
78 ${CMP} "$abs_srcdir"/mex-test2.ok mex-test2.out >/dev/null 2>/dev/null
79 result=$?
80
81 exit $result