xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/xgettext-csharp-4 (revision 9616dacfef448e70e3fbbd865bddf60d54b656c5)
1#!/bin/sh
2
3# Tests for C# plural keyword support
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-cs-4.cs"
9cat <<EOF > xg-cs-4.cs
10class TestCase {
11  public static void Main (String[] args) {
12    GetPluralString("test 1", "plural test");
13    MyPluralString (context, "I've 1", "you've lost");
14  }
15}
16EOF
17
18tmpfiles="$tmpfiles xg-cs-4.po"
19: ${XGETTEXT=xgettext}
20${XGETTEXT} --omit-header --no-location --keyword=MyPluralString:2,3 -d xg-cs-4 xg-cs-4.cs
21test $? = 0 || { rm -fr $tmpfiles; exit 1; }
22
23tmpfiles="$tmpfiles xg-cs-4.ok"
24cat <<EOF > xg-cs-4.ok
25msgid "test 1"
26msgid_plural "plural test"
27msgstr[0] ""
28msgstr[1] ""
29
30msgid "I've 1"
31msgid_plural "you've lost"
32msgstr[0] ""
33msgstr[1] ""
34EOF
35
36: ${DIFF=diff}
37${DIFF} xg-cs-4.ok xg-cs-4.po
38result=$?
39
40rm -fr $tmpfiles
41
42exit $result
43