]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
tests: Add more tests for JavaScript format string
authorDaiki Ueno <ueno@gnu.org>
Mon, 23 May 2016 03:04:23 +0000 (12:04 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 23 May 2016 03:04:23 +0000 (12:04 +0900)
* 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.

gettext-tools/tests/format-javascript-1
gettext-tools/tests/format-javascript-2

index 6e434ea59c95f743f6cee6cf0a592163045dd3d1..0b8db0c9252bab6539d2c856e57a3a30ad992fe3 100755 (executable)
@@ -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}
index d1801b196646537637e8ab3a223ed987298e3540..e613ef8b0af769f6a696e5ec342e5f763c743330 100755 (executable)
@@ -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