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