2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test for --check option.
6 # --check=ellipsis-unicode
7 cat <<\EOF > xg-ellipsis-u.c
8 gettext ("This is a sentence...");
10 ngettext ("This is a sentence", "These are sentences...", 2);
12 /* xgettext: no-ellipsis-unicode-check */
13 gettext ("This is another sentence...");
15 gettext ("This is a multi-sentence example. This is the first sentence. "
16 "This is the second..., no it's not, this is the second sentence...\n"
17 "This is the third sentence...? Perhaps.\n");
20 : ${XGETTEXT=xgettext}
21 LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=ellipsis-unicode -d xg-ellipsis-u.tmp xg-ellipsis-u.c 2>xg-ellipsis-u.err
23 test `grep -c 'ASCII ellipsis' xg-ellipsis-u.err` = 4 || exit 1
25 LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=ellipsis-unicode --sentence-end=double-space -d xg-ellipsis-ud.tmp xg-ellipsis-u.c 2>xg-ellipsis-ud.err
27 test `grep -c 'ASCII ellipsis' xg-ellipsis-ud.err` = 3 || exit 1
29 # --check=space-ellipsis
30 cat <<\EOF > xg-space-e.c
31 gettext ("This is a sentence ...");
33 /* xgettext: no-space-ellipsis-check, no-ellipsis-unicode-check */
34 gettext ("This is another sentence ...");
36 gettext ("This is a multi-sentence example. This is the first sentence. "
37 "This is the second..., no it's not, this is the second sentence ...\n"
38 "This is the third sentence \u2026? Perhaps.\n");
41 LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=space-ellipsis -d xg-space-e.tmp xg-space-e.c 2>xg-space-e.err
43 test `grep -c 'space before ellipsis' xg-space-e.err` = 3 || exit 1
45 # --check=quote-unicode
46 cat <<\EOF > xg-quote-u.c
47 gettext ("\"double quoted\"");
49 /* xgettext: no-quote-unicode-check */
50 gettext ("\"double quoted but ignored\"");
52 gettext ("double quoted but empty \"\"");
54 gettext ("\"\" double quoted but empty");
56 gettext ("\"foo\" \"bar\" \"baz\"");
58 gettext ("'single quoted'");
60 /* xgettext: no-quote-unicode-check */
61 gettext ("'single quoted but ignored'");
63 gettext ("'foo' 'bar' 'baz'");
65 gettext ("prefix'single quoted without surrounding spaces'suffix");
67 gettext ("prefix 'single quoted with surrounding spaces' suffix");
69 gettext ("single quoted with apostrophe, empty '' ");
71 gettext ("'single quoted at the beginning of string' ");
73 gettext (" 'single quoted at the end of string'");
76 "'single quoted at the beginning of line' \n"
80 " 'single quoted at the end of line'\n"
83 gettext ("`single quoted with grave'");
85 /* xgettext: no-quote-unicode-check */
86 gettext ("`single quoted with grave but ignored'");
88 gettext ("single quoted with grave, empty `'");
90 gettext ("`' single quoted with grave, empty");
92 gettext ("`double grave`");
95 LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=quote-unicode -d xg-quote-u.tmp xg-quote-u.c 2>xg-quote-u.err
97 test `grep -c 'ASCII double quote' xg-quote-u.err` = 4 || exit 1
98 test `grep -c 'ASCII single quote' xg-quote-u.err` = 12 || exit 1