• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#! /bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test handling of format and 'range:' flag.
5
6cat <<EOF > mcomm-test27.in1
7msgid "one day"
8msgid_plural "%d days"
9msgstr[0] ""
10msgstr[1] ""
11
12#, c-format, range: 1..6
13msgid "one week and one day"
14msgid_plural "one week and %d days"
15msgstr[0] ""
16msgstr[1] ""
17
18#, c-format, range: 1..7
19msgid "two weeks and one day"
20msgid_plural "two weeks and %d days"
21msgstr[0] ""
22msgstr[1] ""
23
24#, c-format, range: 0..6
25msgid "three weeks and one day"
26msgid_plural "three weeks and %d days"
27msgstr[0] ""
28msgstr[1] ""
29EOF
30
31cat <<EOF > mcomm-test27.in2
32#, c-format, range: 1..6
33msgid "one day"
34msgid_plural "%d days"
35msgstr[0] ""
36msgstr[1] ""
37
38msgid "one week and one day"
39msgid_plural "one week and %d days"
40msgstr[0] ""
41msgstr[1] ""
42
43#, c-format, range: 0..6
44msgid "two weeks and one day"
45msgid_plural "two weeks and %d days"
46msgstr[0] ""
47msgstr[1] ""
48
49#, c-format, range: 1..7
50msgid "three weeks and one day"
51msgid_plural "three weeks and %d days"
52msgstr[0] ""
53msgstr[1] ""
54EOF
55
56: ${MSGCOMM=msgcomm}
57${MSGCOMM} -o mcomm-test27.tmp mcomm-test27.in1 mcomm-test27.in2 || Exit 1
58LC_ALL=C tr -d '\r' < mcomm-test27.tmp > mcomm-test27.out || Exit 1
59
60cat << EOF > mcomm-test27.ok
61#, c-format
62msgid "one day"
63msgid_plural "%d days"
64msgstr[0] ""
65msgstr[1] ""
66
67#, c-format
68msgid "one week and one day"
69msgid_plural "one week and %d days"
70msgstr[0] ""
71msgstr[1] ""
72
73#, c-format, range: 0..7
74msgid "two weeks and one day"
75msgid_plural "two weeks and %d days"
76msgstr[0] ""
77msgstr[1] ""
78
79#, c-format, range: 0..7
80msgid "three weeks and one day"
81msgid_plural "three weeks and %d days"
82msgstr[0] ""
83msgstr[1] ""
84EOF
85
86: ${DIFF=diff}
87${DIFF} mcomm-test27.ok mcomm-test27.out
88result=$?
89
90exit $result
91