Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-tools / tests / msgcomm-3
1 #! /bin/sh
2
3 # Test --omit-header option when there is no header.
4
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
7
8 tmpfiles="$tmpfiles mcomm-test3.in1 mcomm-test3.in2"
9 cat <<EOF > mcomm-test3.in1
10 #: first.c:123
11 msgid "1"
12 msgstr "1x"
13 EOF
14
15 cat <<EOF > mcomm-test3.in2
16 #: hunt.c:759
17 msgid "2"
18 msgstr "2x"
19 EOF
20
21 tmpfiles="$tmpfiles mcomm-test3.tmp mcomm-test3.out"
22 : ${MSGCOMM=msgcomm}
23 ${MSGCOMM} --more-than=0 --omit-header -o mcomm-test3.tmp \
24     mcomm-test3.in1 mcomm-test3.in2
25 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
26 LC_ALL=C tr -d '\r' < mcomm-test3.tmp > mcomm-test3.out
27 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
28
29 tmpfiles="$tmpfiles mcomm-test3.ok"
30 cat << EOF > mcomm-test3.ok
31 #: first.c:123
32 msgid "1"
33 msgstr "1x"
34
35 #: hunt.c:759
36 msgid "2"
37 msgstr "2x"
38 EOF
39
40 : ${DIFF=diff}
41 ${DIFF} mcomm-test3.ok mcomm-test3.out
42 result=$?
43
44 rm -fr $tmpfiles
45
46 exit $result