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