1#!/bin/sh
2#
3# Some tests for java plural keyword support
4#
5
6tmpfiles=""
7trap 'rm -fr $tmpfiles' 1 2 3 15
8
9tmpfiles="$tmpfiles xg-j-3.java"
10cat <<EOF > xg-j-3.java
11class TestCase {
12    public TestCase() {
13        Bundle test = Bundle.getBundle();
14        test.ngettext("test 1", "plural test");
15    }
16}
17EOF
18
19tmpfiles="$tmpfiles xg-j-3.po"
20: ${XGETTEXT=xgettext}
21${XGETTEXT} --omit-header --no-location -d xg-j-3 xg-j-3.java
22test $? = 0 || { rm -fr $tmpfiles; exit 1; }
23
24tmpfiles="$tmpfiles xg-j-3.ok"
25cat <<EOF > xg-j-3.ok
26msgid "test 1"
27msgid_plural "plural test"
28msgstr[0] ""
29msgstr[1] ""
30EOF
31
32: ${DIFF=diff}
33${DIFF} xg-j-3.ok xg-j-3.po
34result=$?
35
36rm -fr $tmpfiles
37
38exit $result
39