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