Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / xgettext-csharp-4
1 #!/bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Tests for C# plural keyword support
5
6 cat <<EOF > xg-cs-4.cs
7 class TestCase {
8   public static void Main (String[] args) {
9     GetPluralString("test 1", "plural test");
10     MyPluralString (context, "I've 1", "you've lost");
11   }
12 }
13 EOF
14
15 : ${XGETTEXT=xgettext}
16 ${XGETTEXT} --omit-header --no-location --keyword=MyPluralString:2,3 \
17   -d xg-cs-4.tmp xg-cs-4.cs || exit 1
18 LC_ALL=C tr -d '\r' < xg-cs-4.tmp.po > xg-cs-4.po || exit 1
19
20 cat <<EOF > xg-cs-4.ok
21 msgid "test 1"
22 msgid_plural "plural test"
23 msgstr[0] ""
24 msgstr[1] ""
25
26 msgid "I've 1"
27 msgid_plural "you've lost"
28 msgstr[0] ""
29 msgstr[1] ""
30 EOF
31
32 : ${DIFF=diff}
33 ${DIFF} xg-cs-4.ok xg-cs-4.po
34 result=$?
35
36 exit $result