xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgmerge-2 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test recognition of duplicates.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles mm-test2.in1 mm-test2.in2"
9cat <<EOF > mm-test2.in1
10msgid "2" msgstr "2"
11msgid "3" msgstr "3"
12msgid "2" msgstr "ha ha"
13EOF
14
15cat <<EOF > mm-test2.in2
16msgid "1" msgstr ""
17msgid "2" msgstr ""
18msgid "3" msgstr ""
19EOF
20
21tmpfiles="$tmpfiles mm-test2.out"
22: ${MSGMERGE=msgmerge}
23LC_MESSAGES=C LC_ALL= \
24${MSGMERGE} -q -o /dev/stdout mm-test2.in1 mm-test2.in2 \
25  2>&1 | grep -v '^==' > mm-test2.out
26
27tmpfiles="$tmpfiles mm-test2.ok"
28cat << EOF > mm-test2.ok
29mm-test2.in1:3: duplicate message definition...
30mm-test2.in1:1: ...this is the location of the first definition
31msgmerge: found 1 fatal error
32EOF
33
34: ${DIFF=diff}
35${DIFF} mm-test2.ok mm-test2.out
36result=$?
37
38rm -fr $tmpfiles
39
40exit $result
41