diff options
author | Daiki Ueno <ueno@gnu.org> | 2016-05-23 12:04:23 +0900 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2016-05-23 12:04:23 +0900 |
commit | 3b5753977df1653edd0db8223610ffd5661be27a (patch) | |
tree | 7ad9bd6fe2739efcca68033421277589a8ef9607 /gettext-tools | |
parent | 9920621eaa425905c52c13ee8a7fadc8d67913e3 (diff) | |
download | external_gettext-3b5753977df1653edd0db8223610ffd5661be27a.zip external_gettext-3b5753977df1653edd0db8223610ffd5661be27a.tar.gz external_gettext-3b5753977df1653edd0db8223610ffd5661be27a.tar.bz2 |
tests: Add more tests for JavaScript format string
* gettext-tools/tests/format-javascript-1: Add test for multiple uses of
same argument.
* gettext-tools/tests/format-javascript-2: Use proper flag to activate
javascript format checker.
Diffstat (limited to 'gettext-tools')
-rwxr-xr-x | gettext-tools/tests/format-javascript-1 | 2 | ||||
-rwxr-xr-x | gettext-tools/tests/format-javascript-2 | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gettext-tools/tests/format-javascript-1 b/gettext-tools/tests/format-javascript-1 index 6e434ea..0b8db0c 100755 --- a/gettext-tools/tests/format-javascript-1 +++ b/gettext-tools/tests/format-javascript-1 @@ -54,6 +54,8 @@ cat <<\EOF > f-js-1.data "abc%+1$d" # Invalid: mixing of numbered and unnumbered arguments "abc%d%2$x" +# Valid: multiple uses of same argument +"abc%2$xdef%1$sghi%2$x" EOF : ${XGETTEXT=xgettext} diff --git a/gettext-tools/tests/format-javascript-2 b/gettext-tools/tests/format-javascript-2 index d1801b1..e613ef8 100755 --- a/gettext-tools/tests/format-javascript-2 +++ b/gettext-tools/tests/format-javascript-2 @@ -14,11 +14,11 @@ msgstr "xyz%" msgid "abc%2sdef" msgstr "xyz%3s" # Invalid: too few arguments -msgid "abc%sdef%u" +msgid "abc%sdef%d" msgstr "xyz%s" # Invalid: too many arguments -msgid "abc%udef" -msgstr "xyz%uvw%c" +msgid "abc%ddef" +msgstr "xyz%dvw%c" # Valid: type compatibility msgid "abc%o" msgstr "xyz%d" @@ -52,7 +52,7 @@ while read comment; do read msgstr_line n=`expr $n + 1` cat <<EOF > f-js-2-$n.po -#, python-format +#, javascript-format ${msgid_line} ${msgstr_line} EOF |