Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test handling of input files with different charsets.
      4  1.1  christos 
      5  1.1  christos tmpfiles=""
      6  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      7  1.1  christos 
      8  1.1  christos tmpfiles="$tmpfiles mcomm-test16.in1 mcomm-test16.in2"
      9  1.1  christos cat <<\EOF > mcomm-test16.in1
     10  1.1  christos # German message file for xyz.
     11  1.1  christos # Copyright (C) 1999, 2000, 2001 xyz.
     12  1.1  christos # Kab Def <ke (at] zzz.uucp>, 2000.
     13  1.1  christos #
     14  1.1  christos msgid ""
     15  1.1  christos msgstr ""
     16  1.1  christos "Project-Id-Version: xyz\n"
     17  1.1  christos "POT-Creation-Date: 2001-04-24 12:51:34+0200\n"
     18  1.1  christos "PO-Revision-Date: 2001-04-24 13:02+02:00\n"
     19  1.1  christos "Last-Translator: Kab Def <ke (at] zzz.uucp>\n"
     20  1.1  christos "Language-Team: German <i18n (at] zzz.uucp>\n"
     21  1.1  christos "MIME-Version: 1.0\n"
     22  1.1  christos "Content-Type: text/plain; charset=ISO-8859-1\n"
     23  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     24  1.1  christos 
     25  1.1  christos #. Help text (HTML-like) START
     26  1.1  christos #: clients/inst_ask_config.ycp:119
     27  1.1  christos msgid ""
     28  1.1  christos "Congratulations!"
     29  1.1  christos msgstr ""
     30  1.1  christos "Glckwunsch!"
     31  1.1  christos EOF
     32  1.1  christos 
     33  1.1  christos cat <<\EOF > mcomm-test16.in2
     34  1.1  christos # German message file for xyz.
     35  1.1  christos # Copyright (C) 1999, 2000, 2001 xyz.
     36  1.1  christos # Kab Def <ke (at] zzz.uucp>, 2000.
     37  1.1  christos #
     38  1.1  christos msgid ""
     39  1.1  christos msgstr ""
     40  1.1  christos "Project-Id-Version: xyz\n"
     41  1.1  christos "POT-Creation-Date: 2001-04-24 12:51:34+0200\n"
     42  1.1  christos "PO-Revision-Date: 2001-04-24 13:02+02:00\n"
     43  1.1  christos "Last-Translator: Kab Def <ke (at] zzz.uucp>\n"
     44  1.1  christos "Language-Team: German <i18n (at] zzz.uucp>\n"
     45  1.1  christos "MIME-Version: 1.0\n"
     46  1.1  christos "Content-Type: text/plain; charset=UTF-8\n"
     47  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     48  1.1  christos 
     49  1.1  christos #. Remind user of the login name he chose
     50  1.1  christos #: clients/inst_ask_config.ycp:72
     51  1.1  christos #, ycp-format
     52  1.1  christos msgid "You can log in as \"%1\"."
     53  1.1  christos msgstr "Sie knnen sich als \"%1\" einloggen."
     54  1.1  christos EOF
     55  1.1  christos 
     56  1.1  christos tmpfiles="$tmpfiles mcomm-test16.out mcomm-test16.err"
     57  1.1  christos rm -f mcomm-test16.out
     58  1.1  christos 
     59  1.1  christos : ${MSGCOMM=msgcomm}
     60  1.1  christos LC_MESSAGES=C LC_ALL= \
     61  1.1  christos ${MSGCOMM} --more-than=0 -o mcomm-test16.out \
     62  1.1  christos     mcomm-test16.in1 mcomm-test16.in2 >mcomm-test16.err 2>&1
     63  1.1  christos result=$?
     64  1.1  christos cat mcomm-test16.err | grep -v 'warning: .* encodings' | grep -v '^ '
     65  1.1  christos test $result = 0 || { rm -fr $tmpfiles; exit 1; }
     66  1.1  christos 
     67  1.1  christos tmpfiles="$tmpfiles mcomm-test16.ok"
     68  1.1  christos cat << \EOF > mcomm-test16.ok
     69  1.1  christos # German message file for xyz.
     70  1.1  christos # Copyright (C) 1999, 2000, 2001 xyz.
     71  1.1  christos # Kab Def <ke (at] zzz.uucp>, 2000.
     72  1.1  christos #
     73  1.1  christos msgid ""
     74  1.1  christos msgstr ""
     75  1.1  christos "Project-Id-Version: xyz\n"
     76  1.1  christos "POT-Creation-Date: 2001-04-24 12:51:34+0200\n"
     77  1.1  christos "PO-Revision-Date: 2001-04-24 13:02+02:00\n"
     78  1.1  christos "Last-Translator: Kab Def <ke (at] zzz.uucp>\n"
     79  1.1  christos "Language-Team: German <i18n (at] zzz.uucp>\n"
     80  1.1  christos "MIME-Version: 1.0\n"
     81  1.1  christos "Content-Type: text/plain; charset=UTF-8\n"
     82  1.1  christos "Content-Transfer-Encoding: 8bit\n"
     83  1.1  christos 
     84  1.1  christos #. Help text (HTML-like) START
     85  1.1  christos #: clients/inst_ask_config.ycp:119
     86  1.1  christos msgid "Congratulations!"
     87  1.1  christos msgstr "Glckwunsch!"
     88  1.1  christos 
     89  1.1  christos #. Remind user of the login name he chose
     90  1.1  christos #: clients/inst_ask_config.ycp:72
     91  1.1  christos #, ycp-format
     92  1.1  christos msgid "You can log in as \"%1\"."
     93  1.1  christos msgstr "Sie knnen sich als \"%1\" einloggen."
     94  1.1  christos EOF
     95  1.1  christos 
     96  1.1  christos : ${DIFF=diff}
     97  1.1  christos ${DIFF} mcomm-test16.ok mcomm-test16.out
     98  1.1  christos result=$?
     99  1.1  christos 
    100  1.1  christos rm -fr $tmpfiles
    101  1.1  christos 
    102  1.1  christos exit $result
    103