Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # -u, --unique (equivalent to --less-than=2): we are interested in unique
      4 # entries only (entries occuring less than 2 times).  But don't drop the
      5 # header entry; otherwise msgcomm will fail for multibyte strings.
      6 
      7 tmpfiles=""
      8 trap 'rm -fr $tmpfiles' 1 2 3 15
      9 
     10 tmpfiles="$tmpfiles mcomm-test17.in1 mcomm-test17.in2 mcomm-test17.in3"
     11 cat <<EOF > mcomm-test17.in1
     12 msgid ""
     13 msgstr ""
     14 "Project-Id-Version: GNU one 1.2.3\n"
     15 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
     16 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
     17 "Last-Translator: Karl Eichwalder <ke (at] suse.de>\n"
     18 "Language-Team: German <de (at] li.org>\n"
     19 "MIME-Version: 1.0\n"
     20 "Content-Type: text/plain; charset=ISO-8859-1\n"
     21 "Content-Transfer-Encoding: 8bit\n"
     22 
     23 # occurs 3 times
     24 #: first.c:123
     25 msgid "1"
     26 msgstr "1x"
     27 EOF
     28 
     29 cat <<EOF > mcomm-test17.in2
     30 msgid ""
     31 msgstr ""
     32 "Project-Id-Version: GNU one 1.2.3\n"
     33 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
     34 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
     35 "Last-Translator: Karl Eichwalder <ke (at] suse.de>\n"
     36 "Language-Team: German <de (at] li.org>\n"
     37 "MIME-Version: 1.0\n"
     38 "Content-Type: text/plain; charset=ISO-8859-1\n"
     39 "Content-Transfer-Encoding: 8bit\n"
     40 
     41 #: hunt.c:759
     42 msgid "1"
     43 msgstr ""
     44 EOF
     45 
     46 cat <<\EOF > mcomm-test17.in3
     47 msgid ""
     48 msgstr ""
     49 "Project-Id-Version: GNU one 1.2.3\n"
     50 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
     51 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
     52 "Last-Translator: Karl Eichwalder <ke (at] suse.de>\n"
     53 "Language-Team: German <de (at] li.org>\n"
     54 "MIME-Version: 1.0\n"
     55 "Content-Type: text/plain; charset=ISO-8859-1\n"
     56 "Content-Transfer-Encoding: 8bit\n"
     57 
     58 #: hunt.c:789
     59 msgid "1"
     60 msgstr ""
     61 
     62 # unique
     63 #: hunt.c:890
     64 msgid "5"
     65 msgstr "fnf"
     66 EOF
     67 
     68 tmpfiles="$tmpfiles mcomm-test17.out"
     69 : ${MSGCOMM=msgcomm}
     70 
     71 ${MSGCOMM} -u \
     72            -o mcomm-test17.out \
     73            mcomm-test17.in1 mcomm-test17.in2 mcomm-test17.in3
     74 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     75 
     76 tmpfiles="$tmpfiles mcomm-test17.ok"
     77 cat << \EOF > mcomm-test17.ok
     78 msgid ""
     79 msgstr ""
     80 "Project-Id-Version: GNU one 1.2.3\n"
     81 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
     82 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
     83 "Last-Translator: Karl Eichwalder <ke (at] suse.de>\n"
     84 "Language-Team: German <de (at] li.org>\n"
     85 "MIME-Version: 1.0\n"
     86 "Content-Type: text/plain; charset=ISO-8859-1\n"
     87 "Content-Transfer-Encoding: 8bit\n"
     88 
     89 # unique
     90 #: hunt.c:890
     91 msgid "5"
     92 msgstr "fnf"
     93 EOF
     94 
     95 : ${DIFF=diff}
     96 ${DIFF} mcomm-test17.ok mcomm-test17.out
     97 result=$?
     98 
     99 rm -fr $tmpfiles
    100 
    101 exit $result
    102