Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-properties-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test handling of obsolete/untranslated messages with Java .properties syntax.
5
6 cat <<EOF > mm-p-1.in1
7 #
8 # def.po
9 #
10 #: file:100
11 not\ existing=but with translation
12
13 #: file2:101
14 !not\ existing\ without\ translation=
15
16 #: file3:102
17 still\ existing=translation
18
19 #
20 # trailing comments should be removed
21 EOF
22
23 cat <<EOF > mm-p-1.in2
24 #
25 # ref.po
26 #
27 #: file3:102
28 still\ existing=here is normally no comment
29
30 #: file4:10
31 !untranslated=
32
33 #
34 # trailing comments should be removed, even here
35 EOF
36
37 : ${MSGMERGE=msgmerge}
38 ${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.tmp mm-p-1.in1 mm-p-1.in2 || exit 1
39 LC_ALL=C tr -d '\r' < mm-p-1.tmp > mm-p-1.out || exit 1
40
41 cat << EOF > mm-p-1.ok
42 #: file3:102
43 still\ existing=translation
44
45 #: file4:10
46 !untranslated=
47 EOF
48
49 : ${DIFF=diff}
50 ${DIFF} mm-p-1.ok mm-p-1.out
51 result=$?
52
53 exit $result