Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-librep-2
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test librep support: --add-comments option.
5
6 cat <<\EOF > xg-lr-2.jl
7 #| a |#
8 #| b |# (setq string #| c |#
9 #| d |#
10 #| e |# (_ #| f |# "hello world" #| g |# ))
11 EOF
12
13 : ${XGETTEXT=xgettext}
14 ${XGETTEXT} --add-comments --omit-header --no-location --keyword=_ \
15   -d xg-lr-2.tmp xg-lr-2.jl || exit 1
16 LC_ALL=C tr -d '\r' < xg-lr-2.tmp.po > xg-lr-2.po || exit 1
17
18 cat <<EOF > xg-lr-2.ok
19 #. a
20 #. b
21 #. c
22 #. d
23 #. e
24 #. f
25 msgid "hello world"
26 msgstr ""
27 EOF
28
29 : ${DIFF=diff}
30 ${DIFF} xg-lr-2.ok xg-lr-2.po
31 result=$?
32
33 exit $result