Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-csharp-8
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test C# support: Unicode character escape handling
5
6 cat <<\EOF > xg-cs-8.cs
7 // Valid:
8 string s1 = "\U00020213";    // Codepoint U+20213
9 string s2 = "\uD840\uDE13";  // Encoded form of U+20213
10 string s3 = "\uD840\U0000DE13";  // Encoded form of U+20213
11 string s4 = "\U0000D840\uDE13";  // Encoded form of U+20213
12 string s5 = "\U0000D840\U0000DE13";  // Encoded form of U+20213
13 string s6 = "\xD840\xDE13";  // Encoded form of U+20213
14
15 // Invalid:
16 string i1 = "\U0020213";    // Unterminated
17 string i2 = "\uD840\u3032";  // Missing low surrogate
18 string i3 = "\uD840\uDE1";    // Unterminated after a high surrogate
19 EOF
20
21 : ${XGETTEXT=xgettext}
22 ${XGETTEXT} --output - --add-location xg-cs-8.cs -a 2>/dev/null | \
23   sed '/\"POT-Creation-Date:.*/d' | LC_ALL=C tr -d '\r' > xg-cs-8.po || \
24   exit 1
25
26 cat <<\EOF > xg-cs-8.ok
27 # SOME DESCRIPTIVE TITLE.
28 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
29 # This file is distributed under the same license as the PACKAGE package.
30 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
31 #
32 #, fuzzy
33 msgid ""
34 msgstr ""
35 "Project-Id-Version: PACKAGE VERSION\n"
36 "Report-Msgid-Bugs-To: \n"
37 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
38 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
39 "Language-Team: LANGUAGE <LL@li.org>\n"
40 "Language: \n"
41 "MIME-Version: 1.0\n"
42 "Content-Type: text/plain; charset=UTF-8\n"
43 "Content-Transfer-Encoding: 8bit\n"
44
45 #: xg-cs-8.cs:2 xg-cs-8.cs:3 xg-cs-8.cs:4 xg-cs-8.cs:5 xg-cs-8.cs:6
46 #: xg-cs-8.cs:7
47 msgid "𠈓"
48 msgstr ""
49
50 #: xg-cs-8.cs:10
51 msgid "\\U0020213"
52 msgstr ""
53
54 #: xg-cs-8.cs:11
55 msgid "�〲"
56 msgstr ""
57
58 #: xg-cs-8.cs:12
59 msgid "�\\uDE1"
60 msgstr ""
61 EOF
62
63 : ${DIFF=diff}
64 ${DIFF} xg-cs-8.ok xg-cs-8.po
65 result=$?
66
67 exit $result