Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgcomm-27
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test handling of format and 'range:' flag.
5
6 cat <<EOF > mcomm-test27.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 > mcomm-test27.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 : ${MSGCOMM=msgcomm}
57 ${MSGCOMM} -o mcomm-test27.tmp mcomm-test27.in1 mcomm-test27.in2 || exit 1
58 LC_ALL=C tr -d '\r' < mcomm-test27.tmp > mcomm-test27.out || exit 1
59
60 cat << EOF > mcomm-test27.ok
61 #, c-format
62 msgid "one day"
63 msgid_plural "%d days"
64 msgstr[0] ""
65 msgstr[1] ""
66
67 #, c-format
68 msgid "one week and one day"
69 msgid_plural "one week and %d days"
70 msgstr[0] ""
71 msgstr[1] ""
72
73 #, c-format, range: 0..7
74 msgid "two weeks and one day"
75 msgid_plural "two weeks and %d days"
76 msgstr[0] ""
77 msgstr[1] ""
78
79 #, c-format, range: 0..7
80 msgid "three weeks and one day"
81 msgid_plural "three weeks and %d days"
82 msgstr[0] ""
83 msgstr[1] ""
84 EOF
85
86 : ${DIFF=diff}
87 ${DIFF} mcomm-test27.ok mcomm-test27.out
88 result=$?
89
90 exit $result