xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgcomm-20 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1#! /bin/sh
2
3# Test --more-than=0; identical message are wanted once only.
4# If the first occurrence is not fuzzy, don't make the result fuzzy.
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9tmpfiles="$tmpfiles mcomm-test20.in1 mcomm-test20.in2"
10cat <<EOF > mcomm-test20.in1
11# Sure.
12#: first.c:123
13msgid "1"
14msgstr "1x"
15EOF
16
17cat <<EOF > mcomm-test20.in2
18# Not sure.
19#: hunt.c:759
20#, fuzzy
21msgid "1"
22msgstr "1x"
23EOF
24
25tmpfiles="$tmpfiles mcomm-test20.out"
26: ${MSGCOMM=msgcomm}
27${MSGCOMM} --more-than=0 -o mcomm-test20.out \
28    mcomm-test20.in1 mcomm-test20.in2
29test $? = 0 || { rm -fr $tmpfiles; exit 1; }
30
31tmpfiles="$tmpfiles mcomm-test20.ok"
32cat << EOF > mcomm-test20.ok
33# Sure.
34#: first.c:123 hunt.c:759
35msgid "1"
36msgstr "1x"
37EOF
38
39: ${DIFF=diff}
40${DIFF} mcomm-test20.ok mcomm-test20.out
41result=$?
42
43rm -fr $tmpfiles
44
45exit $result
46