Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-tcl-4
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test of Tcl support: escape sequences.
5
6 cat <<\EOF > xg-t-4.tcl
7 puts [_ "Hello\u200e\u201cWorld\u201d"]
8 puts [_ "x\u20y\x20z"]
9 puts [_ "\xFF20"]
10 EOF
11
12 : ${XGETTEXT=xgettext}
13 ${XGETTEXT} --add-comments --no-location -k_ -o xg-t-4.tmp xg-t-4.tcl 2>xg-t-4.err
14 test $? = 0 || { cat xg-t-4.err; exit 1; }
15 # Don't simplify this to "grep ... < xg-t-4.tmp", otherwise OpenBSD 4.0 grep
16 # only outputs "Binary file (standard input) matches".
17 cat xg-t-4.tmp | grep -v 'POT-Creation-Date' | LC_ALL=C tr -d '\r' > xg-t-4.pot
18
19 cat <<\EOF > xg-t-4.ok
20 # SOME DESCRIPTIVE TITLE.
21 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
22 # This file is distributed under the same license as the PACKAGE package.
23 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
24 #
25 #, fuzzy
26 msgid ""
27 msgstr ""
28 "Project-Id-Version: PACKAGE VERSION\n"
29 "Report-Msgid-Bugs-To: \n"
30 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
31 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
32 "Language-Team: LANGUAGE <LL@li.org>\n"
33 "Language: \n"
34 "MIME-Version: 1.0\n"
35 "Content-Type: text/plain; charset=UTF-8\n"
36 "Content-Transfer-Encoding: 8bit\n"
37
38 msgid "Hello‎“World”"
39 msgstr ""
40
41 msgid "x y z"
42 msgstr ""
43
44 msgid " "
45 msgstr ""
46 EOF
47
48 : ${DIFF=diff}
49 ${DIFF} xg-t-4.ok xg-t-4.pot
50 result=$?
51
52 exit $result