File: msgmerge-1

package info (click to toggle)
gettext 0.17-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 64,956 kB
  • ctags: 38,653
  • sloc: ansic: 299,024; sh: 49,429; makefile: 8,097; perl: 4,181; lisp: 3,261; yacc: 665; java: 618; cs: 578; sed: 369; objc: 337; cpp: 325; awk: 80; tcl: 63; pascal: 12; php: 8
file content (77 lines) | stat: -rwxr-xr-x 1,393 bytes parent folder | download
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
76
77
#! /bin/sh

# Test general operation and line wrapping.

tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15

tmpfiles="$tmpfiles mm-test1.in1 mm-test1.in2"
cat <<EOF > mm-test1.in1
# first
#. this should be discarded
msgid "1"
msgstr "1x"
# second
#: bogus:1
msgid "2"
msgstr	"this is a really long msgstr "
	"used to test the wrapping to "
	"make sure it works after all "
	"what is a test for if not to test things?"
# third
msgid "3"
msgstr "3z"
EOF

cat <<EOF > mm-test1.in2
#. this is the first
#: snark.c:345
msgid "1"
msgstr ""
#. this is the second
#: hunt.c:759
msgid "2"
msgstr ""
#. this is the third
#: boojum.c:300
msgid "3"
msgstr ""
EOF

tmpfiles="$tmpfiles mm-test1.tmp mm-test1.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q -o mm-test1.tmp mm-test1.in1 mm-test1.in2
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tr -d '\r' < mm-test1.tmp > mm-test1.out
test $? = 0 || { rm -fr $tmpfiles; exit 1; }

tmpfiles="$tmpfiles mm-test1.ok"
cat << EOF > mm-test1.ok
# first
#. this is the first
#: snark.c:345
msgid "1"
msgstr "1x"

# second
#. this is the second
#: hunt.c:759
msgid "2"
msgstr ""
"this is a really long msgstr used to test the wrapping to make sure it works "
"after all what is a test for if not to test things?"

# third
#. this is the third
#: boojum.c:300
msgid "3"
msgstr "3z"
EOF

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

rm -fr $tmpfiles

exit $result