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