Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgexec-3
1 #! /bin/sh
2
3 # Test of an external command with Java .properties syntax.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mex-test3.properties"
9 cat <<\EOF > mex-test3.properties
10 # HEADER.
11 #
12 !=Project-Id-Version\: Bonnie Tyler\n
13
14 #: married-men:4
15 #, fuzzy
16 !The\ world\ is\ full\ of\ married\ men=So viele verheiratete M\u00e4nner
17
18 #: married-men:5
19 with\ wives\ who\ never\ understand=und ihre Frauen verstehen sie nicht
20
21 #: married-men:6
22 !They're\ looking\ for\ someone\ to\ share=
23
24 # schwer zu \u00fcbersetzen...
25 #: married-men:7
26 !the\ excitement\ of\ a\ love\ affair=
27
28 #: married-men:8
29 !Just\ as\ soon\ as\ they\ find\ you=
30
31 #: married-men:9
32 !They\ warn\ you\ and\ darn\ you=
33 EOF
34
35 tmpfiles="$tmpfiles mex-test3.sh"
36 cat <<\EOF > mex-test3.sh
37 #! /bin/sh
38 echo "========================= $MSGEXEC_LOCATION =========================" | LC_ALL=C tr -d '\r'
39 cat <<MEOF
40 $MSGEXEC_MSGID
41 ---
42 MEOF
43 cat
44 echo | LC_ALL=C tr -d '\r'
45 exit 0
46 EOF
47 chmod a+x mex-test3.sh
48
49 tmpfiles="$tmpfiles mex-test3.out"
50 : ${MSGEXEC=msgexec}
51 ${MSGEXEC} --properties-input -i mex-test3.properties ./mex-test3.sh > mex-test3.out
52 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
53
54 tmpfiles="$tmpfiles mex-test3.ok"
55 cat <<\EOF > mex-test3.ok
56 ========================= mex-test3.properties:3 =========================
57
58 ---
59 Project-Id-Version: Bonnie Tyler
60
61 ========================= mex-test3.properties:7 =========================
62 The world is full of married men
63 ---
64 So viele verheiratete Männer
65 ========================= mex-test3.properties:10 =========================
66 with wives who never understand
67 ---
68 und ihre Frauen verstehen sie nicht
69 ========================= mex-test3.properties:13 =========================
70 They're looking for someone to share
71 ---
72
73 ========================= mex-test3.properties:17 =========================
74 the excitement of a love affair
75 ---
76
77 ========================= mex-test3.properties:20 =========================
78 Just as soon as they find you
79 ---
80
81 ========================= mex-test3.properties:23 =========================
82 They warn you and darn you
83 ---
84
85 EOF
86
87 : ${DIFF=diff}
88 ${DIFF} mex-test3.ok mex-test3.out
89 result=$?
90
91 rm -fr $tmpfiles
92
93 exit $result