• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#!/bin/sh
2
3# Test PHP support: string concatenation.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles xg-ph-4.php"
9cat <<EOF > xg-ph-4.php
10<?
11echo _("foo"."bar");
12echo _("hello " .
13"world");
14echo _("1" + "2" . "3");
15echo _("4" . "5" + "6");
16echo _("7" . "8" . "9");
17?>
18EOF
19
20tmpfiles="$tmpfiles xg-ph-4.tmp.po xg-ph-4.po"
21: ${XGETTEXT=xgettext}
22${XGETTEXT} --omit-header --no-location --extract-all \
23  -d xg-ph-4.tmp xg-ph-4.php
24test $? = 0 || { rm -fr $tmpfiles; exit 1; }
25tr -d '\r' < xg-ph-4.tmp.po > xg-ph-4.po
26test $? = 0 || { rm -fr $tmpfiles; exit 1; }
27
28tmpfiles="$tmpfiles xg-ph-4.ok"
29cat <<EOF > xg-ph-4.ok
30msgid "foobar"
31msgstr ""
32
33msgid "hello world"
34msgstr ""
35
36msgid "1"
37msgstr ""
38
39msgid "2"
40msgstr ""
41
42msgid "3"
43msgstr ""
44
45msgid "45"
46msgstr ""
47
48msgid "6"
49msgstr ""
50
51msgid "789"
52msgstr ""
53EOF
54
55: ${DIFF=diff}
56${DIFF} xg-ph-4.ok xg-ph-4.po
57result=$?
58
59rm -fr $tmpfiles
60
61exit $result
62