3 # Test recognition of Emacs Lisp format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-el-1.data"
9 cat <<\EOF
> f-el-1.data
12 # Valid: one character argument
14 # Valid: one integer argument
16 # Valid: one integer argument
18 # Valid: one integer argument
20 # Valid: one integer argument
22 # Valid: one floating-point argument
24 # Valid: one floating-point argument
26 # Valid: one floating-point argument
28 # Valid: one floating-point argument
30 # Valid: one floating-point argument
32 # Valid: one object argument
34 # Valid: one object argument
36 # Valid: one argument with flags
38 # Valid: one argument with width
40 # Valid: one argument with width
42 # Valid: one argument with precision
44 # Valid: one argument with precision
46 # Valid: one argument with width and precision
48 # Valid: one argument with width and precision
50 # Valid: one argument with width and precision
52 # Valid: one argument with width and precision
54 # Invalid: unterminated
56 # Invalid: unknown format specifier
58 # Invalid: flags after width
60 # Invalid: twice precision
62 # Valid: three arguments
64 # Valid: a numbered argument
68 # Valid: two-digit numbered arguments
69 "abc%11$def%10$dgh%9$dij%8$dkl%7$dmn%6$dop%5$dqr%4$dst%3$duv%2$dwx%1$dyz"
70 # Invalid: unterminated number
72 # Invalid: flags before number
74 # Valid: three arguments, two with same number
76 # Invalid: argument with conflicting types
80 # Valid: mixing of numbered and unnumbered arguments
82 # Valid: mixing of numbered and unnumbered arguments
84 # Valid: numbered argument with constant precision
86 # Valid: missing non-final argument
90 # Valid: multiple uses of same argument
91 "abc%2$xdef%1$Sghi%2$x"
92 # Valid: one argument with width
94 # Valid: one argument with width and precision
100 : ${XGETTEXT=xgettext}
102 while read comment
; do
105 tmpfiles
="$tmpfiles f-el-1-$n.in f-el-1-$n.po"
106 cat <<EOF > f-el-1-$n.in
109 ${XGETTEXT} -L EmacsLisp
-o f-el-1-
$n.po f-el-1-
$n.
in ||
exit 1
110 test -f f-el-1-
$n.po ||
exit 1
112 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
113 if grep elisp-format f-el-1-
$n.po
> /dev
/null
; then
119 if grep elisp-format f-el-1-
$n.po
> /dev
/null
; then
125 if test -n "$fail"; then
126 echo "Format string recognition error:" 1>&2
127 cat f-el-1-
$n.
in 1>&2
129 cat f-el-1-
$n.po
1>&2
132 rm -f f-el-1-
$n.
in f-el-1-
$n.po