Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test c-format handling.
      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 mf-test4.po"
      9  1.1  christos cat <<EOF >mf-test4.po
     10  1.1  christos # SOME DESCRIPTIVE TITLE.
     11  1.1  christos # Copyright (C) YEAR Free Software Foundation, Inc.
     12  1.1  christos # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
     13  1.1  christos #
     14  1.1  christos #, fuzzy
     15  1.1  christos msgid ""
     16  1.1  christos msgstr ""
     17  1.1  christos "Project-Id-Version: msgfmt test 4\n"
     18  1.1  christos "PO-Revision-Date: 1996-04-05 19:47+0200\n"
     19  1.1  christos "Last-Translator: Ulrich Drepper <drepper (at] gnu.org>\n"
     20  1.1  christos "Language-Team: test <test (at] li.org>\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 #, no-c-format
     26  1.1  christos msgid "no percent"
     27  1.1  christos msgstr "but here %d is one"
     28  1.1  christos #
     29  1.1  christos #, c-format
     30  1.1  christos msgid "in the %d normal %c order %s\n"
     31  1.1  christos msgstr "but %2$c not %3$s here %1$d\n"
     32  1.1  christos #
     33  1.1  christos # If no c-format is given no check is wanted, not only if no-c-format is there.
     34  1.1  christos msgid "This is a string %s"
     35  1.1  christos msgstr "...but this $s not"
     36  1.1  christos EOF
     37  1.1  christos 
     38  1.1  christos : ${MSGFMT=msgfmt}
     39  1.1  christos ${MSGFMT} -o /dev/null mf-test4.po 2> /dev/null
     40  1.1  christos result=$?
     41  1.1  christos 
     42  1.1  christos rm -fr $tmpfiles
     43  1.1  christos 
     44  1.1  christos exit $result
     45