1 # Test data for test-strfmon, which checks it's implementation in glibc
2 # Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
3 # This file is part of the GNU C Library.
4 # Contributed by Jochen Hein <jochen.hein@delphi.central.de>, 1997.
7 # The GNU C Library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License, or (at your option) any later version.
12 # The GNU C Library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with the GNU C Library; if not, write to the Free
19 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 # The format of this file is pretty simple: Each line contains a test
23 # for strfmon. Fields are separated by TABs. Lines that start with a
24 # '#' are comments and are ignored.
27 # #1 locale which is to be checked
28 # #2 format string which is fed into strfmon
29 # #3 double value that is used for formatting
30 # #4 the expected result (may contain trailing spaces!)
32 # First the implementation without any locale-dependent data
33 # - no currency symbol is printed, formatting is somewhat standard
43 C %=*#9n 1.23 ********1.23
44 C %=*#9n -1.23 -********1.23
46 # check both the german locale and strfmon with that data
48 de_DE.ISO-8859-1 %n 1.23 1,23 DM
49 de_DE.ISO-8859-1 %n -1.23 -1,23 DM
50 de_DE.ISO-8859-1 %n 1234.56 1.234,56 DM
51 de_DE.ISO-8859-1 %11n 123.45 123,45 DM
52 de_DE.ISO-8859-1 %11n -123.45 -123,45 DM
53 de_DE.ISO-8859-1 %11n 3456.781 3.456,78 DM
54 de_DE.ISO-8859-1 %^n 1234.56 1234,56 DM
55 de_DE.ISO-8859-1 %+n 1234.56 1.234,56 DM
56 de_DE.ISO-8859-1 %+n -1234.56 -1.234,56 DM
57 de_DE.ISO-8859-1 %(n 1234.56 1.234,56 DM
58 de_DE.ISO-8859-1 %(n -1234.56 (1.234,56 DM)
59 de_DE.ISO-8859-1 %^n 1234.56 1234,56 DM
60 de_DE.ISO-8859-1 %i 1.23 1,23 DEM
61 de_DE.ISO-8859-1 %i -1.23 -1,23 DEM
62 de_DE.ISO-8859-1 %i 1234.56 1.234,56 DEM
63 de_DE.ISO-8859-1 %^i 1234.56 1234,56 DEM
64 de_DE.ISO-8859-1 %+i 1234.56 1.234,56 DEM
65 de_DE.ISO-8859-1 %+i -1234.56 -1.234,56 DEM
66 de_DE.ISO-8859-1 %(i 1234.56 1.234,56 DEM
67 de_DE.ISO-8859-1 %(i -1234.56 (1.234,56 DEM)
68 de_DE.ISO-8859-1 %^i 1234.56 1234,56 DEM
69 de_DE.ISO-8859-1 %#5n 123.45 123,45 DM
70 de_DE.ISO-8859-1 %#5n -123.45 - 123,45 DM
71 de_DE.ISO-8859-1 %#5n 3456.781 3.456,78 DM
72 de_DE.ISO-8859-1 %=*#5n 123.45 ***123,45 DM
73 de_DE.ISO-8859-1 %=*#5n -123.45 -***123,45 DM
74 de_DE.ISO-8859-1 %=*#5n 3456.781 *3.456,78 DM
75 de_DE.ISO-8859-1 %=0#5n 123.45 000123,45 DM
76 de_DE.ISO-8859-1 %=0#5n -123.45 -000123,45 DM
77 de_DE.ISO-8859-1 %=0#5n 3456.781 03.456,78 DM
78 de_DE.ISO-8859-1 %^#5n 123.45 123,45 DM
79 de_DE.ISO-8859-1 %^#5n -123.45 - 123,45 DM
80 de_DE.ISO-8859-1 %^#5n 3456.781 3456,78 DM
81 de_DE.ISO-8859-1 %^#5.0n 123.45 123 DM
82 de_DE.ISO-8859-1 %^#5.0n -123.45 - 123 DM
83 de_DE.ISO-8859-1 %^#5.0n 3456.781 3457 DM
84 de_DE.ISO-8859-1 %^#5.4n 123.45 123,4500 DM
85 de_DE.ISO-8859-1 %^#5.4n -123.45 - 123,4500 DM
86 de_DE.ISO-8859-1 %^#5.4n 3456.781 3456,7810 DM
87 de_DE.ISO-8859-1 %(#5n 123.45 123,45 DM
88 de_DE.ISO-8859-1 %(#5n -123.45 ( 123,45 DM)
89 de_DE.ISO-8859-1 %(#5n 3456.781 3.456,78 DM
90 de_DE.ISO-8859-1 %!(#5n 123.45 123,45
91 de_DE.ISO-8859-1 %!(#5n -123.45 ( 123,45)
92 de_DE.ISO-8859-1 %!(#5n 3456.781 3.456,78
94 # check both the en_US locale and strfmon with that data
95 # a lot of this checks are created from a strfmon(3) man-page.
97 en_US.ISO-8859-1 %n 123.45 $123.45
98 en_US.ISO-8859-1 %n -123.45 -$123.45
99 en_US.ISO-8859-1 %n 3456.781 $3,456.78
100 en_US.ISO-8859-1 %i 123.45 USD 123.45
101 en_US.ISO-8859-1 %i -123.45 -USD 123.45
102 en_US.ISO-8859-1 %i 3456.781 USD 3,456.78
103 en_US.ISO-8859-1 %11n 123.45 $123.45
104 en_US.ISO-8859-1 %11n -123.45 -$123.45
105 en_US.ISO-8859-1 %11n 3456.781 $3,456.78
106 en_US.ISO-8859-1 %=*#5n 123.45 $***123.45
107 en_US.ISO-8859-1 %=*#5n -123.45 -$***123.45
108 en_US.ISO-8859-1 %=*#5n 3456.781 $*3,456.78
109 en_US.ISO-8859-1 %=0#5n 123.45 $000123.45
110 en_US.ISO-8859-1 %=0#5n -123.45 -$000123.45
111 en_US.ISO-8859-1 %=0#5n 3456.781 $03,456.78
112 en_US.ISO-8859-1 %^#5n 123.45 $ 123.45
113 en_US.ISO-8859-1 %^#5n -123.45 -$ 123.45
114 en_US.ISO-8859-1 %^#5n 3456.781 $ 3456.78
115 en_US.ISO-8859-1 %^#5.0n 123.45 $ 123
116 en_US.ISO-8859-1 %^#5.0n -123.45 -$ 123
117 en_US.ISO-8859-1 %^#5.0n 3456.781 $ 3457
118 en_US.ISO-8859-1 %^#5.4n 123.45 $ 123.4500
119 en_US.ISO-8859-1 %^#5.4n -123.45 -$ 123.4500
120 en_US.ISO-8859-1 %^#5.4n 3456.781 $ 3456.7810
121 en_US.ISO-8859-1 %(#5n 123.45 $ 123.45
122 en_US.ISO-8859-1 %(#5n -123.45 ($ 123.45)
123 en_US.ISO-8859-1 %(#5n 3456.781 $ 3,456.78
124 en_US.ISO-8859-1 %!(#5n 123.45 123.45
125 en_US.ISO-8859-1 %!(#5n -123.45 ( 123.45)
126 en_US.ISO-8859-1 %!(#5n 3456.781 3,456.78
127 en_US.ISO-8859-1 %#5n 123.45 $ 123.45
128 en_US.ISO-8859-1 %#5n -123.45 -$ 123.45
129 en_US.ISO-8859-1 %#5n 3456.781 $ 3,456.78
131 # check all cs_precedes/sign_posn/sep_by_space combinations using
132 # special test locales. The six characters after the "_" indicate
133 # these three values for positive and then negative quantities.
135 tstfmon_n01y12 %n 123.45 123.45 $
136 tstfmon_n01y12 %n -123.45 - $123.45
137 tstfmon_n01y12 %11n 123.45 123.45 $
138 tstfmon_n01y12 %11n -123.45 - $123.45
139 tstfmon_n01y12 %^=*#5n 123.45 **123.45 $
140 tstfmon_n01y12 %^=*#5n -123.45 - $**123.45
142 tstfmon_n02n40 %n 123.45 123.45$
143 tstfmon_n02n40 %n -123.45 123.45$-
144 tstfmon_n02n40 %11n 123.45 123.45$
145 tstfmon_n02n40 %11n -123.45 123.45$-
146 tstfmon_n02n40 %^=*#5n 123.45 **123.45$
147 tstfmon_n02n40 %^=*#5n -123.45 **123.45$-
149 tstfmon_n10y31 %n 123.45 +123.45$
150 tstfmon_n10y31 %n -123.45 -$ 123.45
151 tstfmon_n10y31 %11n 123.45 +123.45$
152 tstfmon_n10y31 %11n -123.45 -$ 123.45
153 tstfmon_n10y31 %^=*#5n 123.45 +**123.45$
154 tstfmon_n10y31 %^=*#5n -123.45 -$ **123.45
156 tstfmon_n11y41 %n 123.45 +123.45 $
157 tstfmon_n11y41 %n -123.45 $- 123.45
158 tstfmon_n11y41 %11n 123.45 +123.45 $
159 tstfmon_n11y41 %11n -123.45 $- 123.45
160 tstfmon_n11y41 %^=*#5n 123.45 +**123.45 $
161 tstfmon_n11y41 %^=*#5n -123.45 $- **123.45
163 tstfmon_n12y11 %n 123.45 +123.45$
164 tstfmon_n12y11 %n -123.45 -$ 123.45
165 tstfmon_n12y11 %11n 123.45 +123.45$
166 tstfmon_n12y11 %11n -123.45 -$ 123.45
167 tstfmon_n12y11 %^=*#5n 123.45 +**123.45$
168 tstfmon_n12y11 %^=*#5n -123.45 -$ **123.45
170 tstfmon_n20n32 %n 123.45 123.45$+
171 tstfmon_n20n32 %n -123.45 123.45- $
172 tstfmon_n20n32 %11n 123.45 123.45$+
173 tstfmon_n20n32 %11n -123.45 123.45- $
174 tstfmon_n20n32 %^=*#5n 123.45 **123.45$+
175 tstfmon_n20n32 %^=*#5n -123.45 **123.45- $
177 tstfmon_n30y20 %n 123.45 123.45+$
178 tstfmon_n30y20 %n -123.45 $123.45-
179 tstfmon_n30y20 %11n 123.45 123.45+$
180 tstfmon_n30y20 %11n -123.45 $123.45-
181 tstfmon_n30y20 %^=*#5n 123.45 **123.45+$
182 tstfmon_n30y20 %^=*#5n -123.45 $**123.45-
184 tstfmon_n41n00 %n 123.45 123.45 $+
185 tstfmon_n41n00 %n -123.45 (123.45$)
186 tstfmon_n41n00 %11n 123.45 123.45 $+
187 tstfmon_n41n00 %11n -123.45 (123.45$)
188 tstfmon_n41n00 %^=*#5n 123.45 **123.45 $+
189 tstfmon_n41n00 %^=*#5n -123.45 (**123.45$)
191 tstfmon_y01y10 %n 123.45 $ 123.45
192 tstfmon_y01y10 %n -123.45 -$123.45
193 tstfmon_y01y10 %11n 123.45 $ 123.45
194 tstfmon_y01y10 %11n -123.45 -$123.45
195 tstfmon_y01y10 %^=*#5n 123.45 $ **123.45
196 tstfmon_y01y10 %^=*#5n -123.45 -$**123.45
198 tstfmon_y02n22 %n 123.45 $123.45
199 tstfmon_y02n22 %n -123.45 123.45$ O/D
200 tstfmon_y02n22 %12n 123.45 $123.45
201 tstfmon_y02n22 %12n -123.45 123.45$ O/D
202 tstfmon_y02n22 %^=*#5n 123.45 $**123.45
203 tstfmon_y02n22 %^=*#5n -123.45 **123.45$ O/D
205 tstfmon_y22n42 %n 123.45 $123.45+
206 tstfmon_y22n42 %n -123.45 123.45$ -
207 tstfmon_y22n42 %11n 123.45 $123.45+
208 tstfmon_y22n42 %11n -123.45 123.45$ -
209 tstfmon_y22n42 %^=*#5n 123.45 $**123.45+
210 tstfmon_y22n42 %^=*#5n -123.45 **123.45$ -
212 tstfmon_y30y21 %n 123.45 +$123.45
213 tstfmon_y30y21 %n -123.45 $ 123.45-
214 tstfmon_y30y21 %11n 123.45 +$123.45
215 tstfmon_y30y21 %11n -123.45 $ 123.45-
216 tstfmon_y30y21 %^=*#5n 123.45 +$**123.45
217 tstfmon_y30y21 %^=*#5n -123.45 $ **123.45-
219 tstfmon_y32n31 %n 123.45 + $123.45
220 tstfmon_y32n31 %n -123.45 123.45 -$
221 tstfmon_y32n31 %11n 123.45 + $123.45
222 tstfmon_y32n31 %11n -123.45 123.45 -$
223 tstfmon_y32n31 %^=*#5n 123.45 + $**123.45
224 tstfmon_y32n31 %^=*#5n -123.45 **123.45 -$
226 tstfmon_y40y00 %n 123.45 $+123.45
227 tstfmon_y40y00 %n -123.45 ($123.45)
228 tstfmon_y40y00 %11n 123.45 $+123.45
229 tstfmon_y40y00 %11n -123.45 ($123.45)
230 tstfmon_y40y00 %^=*#5n 123.45 $+**123.45
231 tstfmon_y40y00 %^=*#5n -123.45 ($**123.45)
233 tstfmon_y42n21 %n 123.45 $ +123.45
234 tstfmon_y42n21 %n -123.45 123.45 $-
235 tstfmon_y42n21 %11n 123.45 $ +123.45
236 tstfmon_y42n21 %11n -123.45 123.45 $-
237 tstfmon_y42n21 %^=*#5n 123.45 $ +**123.45
238 tstfmon_y42n21 %^=*#5n -123.45 **123.45 $-