summaryrefslogtreecommitdiffstats
path: root/gettext-tools/tests/xgettext-14
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2016-02-22 16:43:16 +0900
committerDaiki Ueno <ueno@gnu.org>2016-02-22 17:59:40 +0900
commitb0af5330b31f467d24f009e989428a9cf8d6ffe2 (patch)
treead3d98695b0fb5db951f550b360cf77c02f475e1 /gettext-tools/tests/xgettext-14
parent16c93d9147d3e1fb710b6f8a8c4b56d22ec37ca6 (diff)
downloadexternal_gettext-b0af5330b31f467d24f009e989428a9cf8d6ffe2.zip
external_gettext-b0af5330b31f467d24f009e989428a9cf8d6ffe2.tar.gz
external_gettext-b0af5330b31f467d24f009e989428a9cf8d6ffe2.tar.bz2
xgettext: Add new check bullet-unicode
* gettext-tools/src/xgettext.c (main): Generalize --check option handling. * gettext-tools/src/message.h (enum syntax_check_type): New enum value sc_bullet_unicode. (NSYNTAXCHECKS): Increment. * gettext-tools/src/message.c (syntax_check_name): Add name for sc_bullet_unicode. * gettext-tools/src/msgl-check.c (struct bullet_ty, struct bullet_stack_ty): New struct. (bullet_stack): New variable. (syntax_check_bullet_unicode): New function. (sc_funcs): Register syntax_check_bullet_unicode as a check function for sc_bullet_unicode. * gettext-tools/tests/xgettext-14: Add tests for --check=bullet-unicode
Diffstat (limited to 'gettext-tools/tests/xgettext-14')
-rwxr-xr-xgettext-tools/tests/xgettext-1437
1 files changed, 37 insertions, 0 deletions
diff --git a/gettext-tools/tests/xgettext-14 b/gettext-tools/tests/xgettext-14
index b769b2f..8df8a04 100755
--- a/gettext-tools/tests/xgettext-14
+++ b/gettext-tools/tests/xgettext-14
@@ -96,3 +96,40 @@ LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=quote-unicod
test `grep -c 'ASCII double quote' xg-quote-u.err` = 4 || exit 1
test `grep -c 'ASCII single quote' xg-quote-u.err` = 12 || exit 1
+
+# --check=bullet-unicode
+cat <<\EOF > xg-bullet-u1.c
+gettext ("The following is a list of items:\n\
+* item 1\n\
+* item 2\n\
+* item 3\n");
+EOF
+
+: ${XGETTEXT=xgettext}
+LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=bullet-unicode -d xg-bullet-u1.tmp xg-bullet-u1.c 2>xg-bullet-u1.err
+
+test `grep -c 'ASCII bullet' xg-bullet-u1.err` = 1 || { cat xg-bullet-u1.err; exit 1; }
+
+cat <<\EOF > xg-bullet-u2.c
+gettext ("The following is a list of items:\n\
+* item 1\n\
+ - item 2\n\
+* item 3\n");
+EOF
+
+: ${XGETTEXT=xgettext}
+LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=bullet-unicode -d xg-bullet-u2.tmp xg-bullet-u2.c 2>xg-bullet-u2.err
+
+test `grep -c 'ASCII bullet' xg-bullet-u2.err` = 1 || { cat xg-bullet-u2.err; exit 1; }
+
+cat <<\EOF > xg-bullet-u3.c
+gettext ("The following is NOT a list of items:\n\
+* item 1\n\
+- item 2\n\
+* item 3\n");
+EOF
+
+: ${XGETTEXT=xgettext}
+LANGUAGE= LC_ALL=C ${XGETTEXT} --omit-header --add-comments --check=bullet-unicode -d xg-bullet-u3.tmp xg-bullet-u3.c 2>xg-bullet-u3.err
+
+test `grep -c 'ASCII bullet' xg-bullet-u3.err` = 0 || { cat xg-bullet-u3.err; exit 1; }