summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/msgfmt-12
blob: 19f9383379274631c53719966e25e600eb0fe132 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#! /bin/sh
. "${srcdir=.}/init.sh"; path_prepend_ . ../src

# Test ISO C 99 <inttypes.h> format string directives.

cat <<\EOF > mf-12.po
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"

#, c-format
msgid "File size is: %<PRId64>"
msgstr "Dateigröße ist: %<PRId64>"

#, c-format
msgid "File age is %10<PRIdMAX> microseconds"
msgstr "Datei ist %10<PRIdMAX> Mikrosekunden alt."

msgid "<PRIXFAST16> errors"
msgstr "<PRIXFAST16> Fehler"
EOF

: ${MSGFMT=msgfmt}
${MSGFMT} -o mf-12.mo mf-12.po || Exit 1

: ${MSGUNFMT=msgunfmt}
${MSGUNFMT} -o mf-12.tmp mf-12.mo || Exit 1
LC_ALL=C tr -d '\r' < mf-12.tmp > mf-12.out || Exit 1

cat <<\EOF > mf-12.ok
msgid ""
msgstr "Content-Type: text/plain; charset=ISO-8859-1\n"

msgid "<PRIXFAST16> errors"
msgstr "<PRIXFAST16> Fehler"

#, c-format
msgid "File size is: %<PRId64>"
msgstr "Dateigröße ist: %<PRId64>"

#, c-format
msgid "File age is %10<PRIdMAX> microseconds"
msgstr "Datei ist %10<PRIdMAX> Mikrosekunden alt."
EOF

: ${DIFF=diff}
${DIFF} mf-12.ok mf-12.out
result=$?

exit $result