2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of Emacs Lisp format strings.
6 cat <<\EOF > f-el-1.data
9 # Valid: one character argument
11 # Valid: one integer argument
13 # Valid: one integer argument
15 # Valid: one integer argument
17 # Valid: one integer argument
19 # Valid: one floating-point argument
21 # Valid: one floating-point argument
23 # Valid: one floating-point argument
25 # Valid: one floating-point argument
27 # Valid: one floating-point argument
29 # Valid: one object argument
31 # Valid: one object argument
33 # Valid: one argument with flags
35 # Valid: one argument with width
37 # Valid: one argument with width
39 # Valid: one argument with precision
41 # Valid: one argument with precision
43 # Valid: one argument with width and precision
45 # Valid: one argument with width and precision
47 # Valid: one argument with width and precision
49 # Valid: one argument with width and precision
51 # Invalid: unterminated
53 # Invalid: unknown format specifier
55 # Invalid: flags after width
57 # Invalid: twice precision
59 # Valid: three arguments
61 # Valid: a numbered argument
65 # Valid: two-digit numbered arguments
66 "abc%11$def%10$dgh%9$dij%8$dkl%7$dmn%6$dop%5$dqr%4$dst%3$duv%2$dwx%1$dyz"
67 # Invalid: unterminated number
69 # Invalid: flags before number
71 # Valid: three arguments, two with same number
73 # Invalid: argument with conflicting types
77 # Valid: mixing of numbered and unnumbered arguments
79 # Valid: mixing of numbered and unnumbered arguments
81 # Valid: numbered argument with constant precision
83 # Valid: missing non-final argument
87 # Valid: multiple uses of same argument
88 "abc%2$xdef%1$Sghi%2$x"
89 # Valid: one argument with width
91 # Valid: one argument with width and precision
97 : ${XGETTEXT=xgettext}
99 while read comment; do
102 cat <<EOF > f-el-1-$n.in
105 ${XGETTEXT} -L EmacsLisp -o f-el-1-$n.po f-el-1-$n.in || exit 1
106 test -f f-el-1-$n.po || exit 1
108 if echo "$comment" | grep 'Valid:' > /dev/null; then
109 if grep elisp-format f-el-1-$n.po > /dev/null; then
115 if grep elisp-format f-el-1-$n.po > /dev/null; then
121 if test -n "$fail"; then
122 echo "Format string recognition error:" 1>&2
123 cat f-el-1-$n.in 1>&2
125 cat f-el-1-$n.po 1>&2
128 rm -f f-el-1-$n.in f-el-1-$n.po