No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-csharp-1
blob84b5d96041d4a7d39b6348cb29036ba416bc8193
1 #!/bin/sh
3 # Some tests for C# support
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles xg-cs-1.cs"
9 cat <<EOF > xg-cs-1.cs
10 using GNU.Gettext;
11 class TestCase {
12 public TestCase() {
13 GettextResourceManager rm = new GettextResourceManager("test");
14 // standard usage
15 String test1 = rm.GetString("Test String 1");
16 /* C style comment */
17 String test2 = rm.GetString("Test String 2");
18 // C# "multiline" string
19 String test3 = rm.GetString("Test " +
20 "String " +
21 "3");
22 // empty string
23 String test4 = rm.GetString("");
24 #if false
25 // commented out through #if
26 String test5 = rm.GetString("Test String 5");
27 #endif
30 EOF
32 tmpfiles="$tmpfiles xg-cs-1.po"
33 : ${XGETTEXT=xgettext}
34 ${XGETTEXT} --omit-header --no-location -c -d xg-cs-1 xg-cs-1.cs
35 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
37 tmpfiles="$tmpfiles xg-cs-1.ok"
38 cat <<EOF > xg-cs-1.ok
39 #. standard usage
40 msgid "Test String 1"
41 msgstr ""
43 #. C style comment
44 msgid "Test String 2"
45 msgstr ""
47 #. C# "multiline" string
48 msgid "Test String 3"
49 msgstr ""
51 #. empty string
52 msgid ""
53 msgstr ""
55 #. commented out through #if
56 msgid "Test String 5"
57 msgstr ""
58 EOF
60 : ${DIFF=diff}
61 ${DIFF} xg-cs-1.ok xg-cs-1.po
62 result=$?
64 rm -fr $tmpfiles
66 exit $result