xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgmerge-properties-1 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test handling of obsolete/untranslated messages with Java .properties syntax.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles mm-p-1.in1 mm-p-1.in2"
9cat <<EOF > mm-p-1.in1
10#
11# def.po
12#
13#: file:100
14not\ existing=but with translation
15
16#: file2:101
17!not\ existing\ without\ translation=
18
19#: file3:102
20still\ existing=translation
21
22#
23# trailing comments should be removed
24EOF
25
26cat <<EOF > mm-p-1.in2
27#
28# ref.po
29#
30#: file3:102
31still\ existing=here is normally no comment
32
33#: file4:10
34!untranslated=
35
36#
37# trailing comments should be removed, even here
38EOF
39
40tmpfiles="$tmpfiles mm-p-1.out"
41: ${MSGMERGE=msgmerge}
42${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.out mm-p-1.in1 mm-p-1.in2
43test $? = 0 || { rm -fr $tmpfiles; exit 1; }
44
45tmpfiles="$tmpfiles mm-p-1.ok"
46cat << EOF > mm-p-1.ok
47#: file3:102
48still\ existing=translation
49
50#: file4:10
51!untranslated=
52EOF
53
54: ${DIFF=diff}
55${DIFF} mm-p-1.ok mm-p-1.out
56result=$?
57
58rm -fr $tmpfiles
59
60exit $result
61