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