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