projects
/
platform
/
upstream
/
gettext.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 0.19.7
[platform/upstream/gettext.git]
/
gettext-tools
/
tests
/
format-scheme-2
diff --git
a/gettext-tools/tests/format-scheme-2
b/gettext-tools/tests/format-scheme-2
index
0be970f
..
44829ae
100755
(executable)
--- a/
gettext-tools/tests/format-scheme-2
+++ b/
gettext-tools/tests/format-scheme-2
@@
-1,11
+1,8
@@
#! /bin/sh
#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
# Test checking of Lisp format strings.
# Test checking of Lisp format strings.
-tmpfiles=""
-trap 'rm -fr $tmpfiles' 1 2 3 15
-
-tmpfiles="$tmpfiles f-sc-2.data"
cat <<\EOF > f-sc-2.data
# Valid: ~~ doesn't count
msgid "abc~~def"
cat <<\EOF > f-sc-2.data
# Valid: ~~ doesn't count
msgid "abc~~def"
@@
-181,6
+178,11
@@
msgstr "xyz~{~1@*~C~2:*~D~^~1*~}"
# Invalid: ~^ inside iteration depends on position
msgid "abc~{~D ~^~C~}"
msgstr "xyz~{~1@*~C~2:*~D~1*~^~}"
# Invalid: ~^ inside iteration depends on position
msgid "abc~{~D ~^~C~}"
msgstr "xyz~{~1@*~C~2:*~D~1*~^~}"
+# Invalid: type compatibility with non-strict checking
+msgid "abc~{~c~c~}"
+msgid_plural "abc~{~c~c~}"
+msgstr[0] "xyz~{~c~d~}"
+msgstr[1] "xyz~{~c~d~}"
EOF
: ${MSGFMT=msgfmt}
EOF
: ${MSGFMT=msgfmt}
@@
-188,13
+190,28
@@
n=0
while read comment; do
read msgid_line
read msgstr_line
while read comment; do
read msgid_line
read msgstr_line
+ msgid_plural_line=""
+ if echo "$msgstr_line" | grep '^msgid_plural' > /dev/null; then
+ msgid_plural_line="$msgstr_line"
+ read msgstr0_line
+ read msgstr1_line
+ fi
n=`expr $n + 1`
n=`expr $n + 1`
- tmpfiles="$tmpfiles f-sc-2-$n.po f-sc-2-$n.mo"
- cat <<EOF > f-sc-2-$n.po
+ if test -z "$msgid_plural_line"; then
+
cat <<EOF > f-sc-2-$n.po
#, scheme-format
${msgid_line}
${msgstr_line}
EOF
#, scheme-format
${msgid_line}
${msgstr_line}
EOF
+ else
+ cat <<EOF > f-l-2-$n.po
+#, lisp-format
+${msgid_line}
+${msgid_plural_line}
+${msgstr0_line}
+${msgstr1_line}
+EOF
+ fi
fail=
if echo "$comment" | grep 'Valid:' > /dev/null; then
if ${MSGFMT} --check-format -o f-sc-2-$n.mo f-sc-2-$n.po; then
fail=
if echo "$comment" | grep 'Valid:' > /dev/null; then
if ${MSGFMT} --check-format -o f-sc-2-$n.mo f-sc-2-$n.po; then
@@
-218,6
+235,4
@@
EOF
rm -f f-sc-2-$n.po f-sc-2-$n.mo
done < f-sc-2.data
rm -f f-sc-2-$n.po f-sc-2-$n.mo
done < f-sc-2.data
-rm -fr $tmpfiles
-
exit 0
exit 0