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