No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / xgettext-java-1
blobcd7f12ec79f8bc107ccac45695f31c8cd868e305
1 #!/bin/sh
3 # Some tests for java support
6 tmpfiles=""
7 trap 'rm -fr $tmpfiles' 1 2 3 15
9 tmpfiles="$tmpfiles xg-j-1.java"
10 cat <<EOF > xg-j-1.java
11 class TestCase {
12 public TestCase() {
13 ResourceBundle b = ResourceBundle.getBundle("test");
14 GetTextBundle b2 = (GetTextBundle)b;
15 // standard usage
16 String test1 = b.getString("Test String 1");
17 // gettext usage
18 String test2 = b2.gettext("Test String 2");
20 /* C style comment */
21 String test3 = b.getString("Test String 3");
23 // java "multiline" string
24 String test4 = b.getString("Test " +
25 "String " +
26 "4");
28 // empty string
29 String test5 = b.getString("");
32 EOF
34 tmpfiles="$tmpfiles xg-j-1.po"
35 : ${XGETTEXT=xgettext}
36 ${XGETTEXT} --omit-header --no-location -c -d xg-j-1 xg-j-1.java
37 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
39 tmpfiles="$tmpfiles xg-j-1.ok"
40 cat <<EOF > xg-j-1.ok
41 #. standard usage
42 msgid "Test String 1"
43 msgstr ""
45 #. gettext usage
46 msgid "Test String 2"
47 msgstr ""
49 #. C style comment
50 msgid "Test String 3"
51 msgstr ""
53 #. java "multiline" string
54 msgid "Test String 4"
55 msgstr ""
57 #. empty string
58 msgid ""
59 msgstr ""
60 EOF
62 : ${DIFF=diff}
63 ${DIFF} xg-j-1.ok xg-j-1.po
64 result=$?
66 rm -fr $tmpfiles
68 exit $result