summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/msgmerge-properties-1
blob: f7554b638f8bba855d19c5a6c0694088c488cdea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test handling of obsolete/untranslated messages with Java .properties syntax.

cat <<EOF > mm-p-1.in1
#
# def.po
#
#: file:100
not\ existing=but with translation

#: file2:101
!not\ existing\ without\ translation=

#: file3:102
still\ existing=translation

#
# trailing comments should be removed
EOF

cat <<EOF > mm-p-1.in2
#
# ref.po
#
#: file3:102
still\ existing=here is normally no comment

#: file4:10
!untranslated=

#
# trailing comments should be removed, even here
EOF

: ${MSGMERGE=msgmerge}
${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.tmp mm-p-1.in1 mm-p-1.in2 || Exit 1
LC_ALL=C tr -d '\r' < mm-p-1.tmp > mm-p-1.out || Exit 1

cat << EOF > mm-p-1.ok
#: file3:102
still\ existing=translation

#: file4:10
!untranslated=
EOF

: ${DIFF=diff}
${DIFF} mm-p-1.ok mm-p-1.out
result=$?

exit $result