summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/msgmerge-5
blob: 0b25be23c036ca608254bb1f82ab72ef7fccb5d9 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test handling of header entry.

cat <<EOF > mm-test5.in1.po
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Content-Transfer-Encoding: ENCODING\n"
"MIME-Version: 1.0\n"
"Test: bla bla\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Project-Id-Version: PACKAGE VERSION\n"

msgid ""
"whatever, doesn't matter\n"
msgstr ""
"blah blah blah blah blah blah blah blah blah blah blah blah blah bla bla bla\n"
EOF

cat <<EOF > mm-test5.in2.po
msgid ""
msgstr ""

msgid ""
"whatever, doesn't matter\n"
msgstr ""
"blah blah blah blah blah blah blah blah blah blah blah blah blah bla bla bla\n"
EOF

: ${MSGMERGE=msgmerge}
LC_MESSAGES=C LC_ALL= \
${MSGMERGE} -q -o mm-test5.tmp mm-test5.in1.po mm-test5.in2.po >mm-test5.err 2>&1
result=$?
cat mm-test5.err | grep -v 'warning: Charset' | grep -v '^ '
test $result = 0 || { Exit 1; }
LC_ALL=C tr -d '\r' < mm-test5.tmp > mm-test5.out || Exit 1

cat <<EOF > mm-test5.ok
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR Free Software Foundation, Inc.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI +ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: ENCODING\n"
"Test: bla bla\n"

msgid "whatever, doesn't matter\n"
msgstr ""
"blah blah blah blah blah blah blah blah blah blah blah blah blah bla bla "
"bla\n"
EOF

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

exit $result