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