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