~win-cross-dev/win-cross/gettext

« back to all changes in this revision

Viewing changes to gettext-tools/tests/msgen-1

  • Committer: Nathan Osman
  • Date: 2012-08-11 05:06:52 UTC
  • Revision ID: admin@quickmediasolutions.com-20120811050652-ochkxjtonbw6kkve
Initial commit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
 
 
3
# Test general operation.
 
4
 
 
5
tmpfiles=""
 
6
trap 'rm -fr $tmpfiles' 1 2 3 15
 
7
 
 
8
tmpfiles="$tmpfiles men-test1.po"
 
9
cat <<EOF > men-test1.po
 
10
# HEADER.
 
11
#
 
12
msgid ""
 
13
msgstr ""
 
14
"Content-Type: text/plain; charset=ASCII\n"
 
15
"Content-Transfer-Encoding: 8bit\n"
 
16
 
 
17
msgid "height must be positive"
 
18
msgstr ""
 
19
 
 
20
msgid "color cannot be transparent"
 
21
msgstr "colour cannot be transparent"
 
22
 
 
23
msgid "width must be positive"
 
24
msgstr ""
 
25
 
 
26
msgid "%d error"
 
27
msgid_plural "%d errors"
 
28
msgstr[0] ""
 
29
msgstr[1] ""
 
30
EOF
 
31
 
 
32
tmpfiles="$tmpfiles men-test1.tmp men-test1.out"
 
33
: ${MSGEN=msgen}
 
34
${MSGEN} -o men-test1.tmp men-test1.po
 
35
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
36
LC_ALL=C tr -d '\r' < men-test1.tmp > men-test1.out
 
37
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
 
38
 
 
39
tmpfiles="$tmpfiles men-test1.ok"
 
40
cat <<EOF > men-test1.ok
 
41
# HEADER.
 
42
#
 
43
msgid ""
 
44
msgstr ""
 
45
"Content-Type: text/plain; charset=ASCII\n"
 
46
"Content-Transfer-Encoding: 8bit\n"
 
47
 
 
48
msgid "height must be positive"
 
49
msgstr "height must be positive"
 
50
 
 
51
msgid "color cannot be transparent"
 
52
msgstr "colour cannot be transparent"
 
53
 
 
54
msgid "width must be positive"
 
55
msgstr "width must be positive"
 
56
 
 
57
msgid "%d error"
 
58
msgid_plural "%d errors"
 
59
msgstr[0] "%d error"
 
60
msgstr[1] "%d errors"
 
61
EOF
 
62
 
 
63
: ${DIFF=diff}
 
64
${DIFF} men-test1.ok men-test1.out
 
65
result=$?
 
66
 
 
67
rm -fr $tmpfiles
 
68
 
 
69
exit $result