
1: # Test data for test-strfmon, which checks it's implementation in glibc 2: # Copyright (C) 1996, 1997, 2000, 2002, 2003 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. 5: # 6: 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. 11: 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. 16: 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 20: # 02111-1307 USA. 21: 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. 25: # 26: # Field Description 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!) 31: # This field might be enclosed with "" to make it easier to see 32: # the white space 33: # 34: # First the implementation without any locale-dependent data 35: # - no currency symbol is printed, formatting is somewhat standard 36: C %n 1.23 1.23 37: C %n -1.23 -1.23 38: C %n 0 0.00 39: C %% 0 % 40: C *%n* 1.23 *1.23* 41: C %9n 1.23 1.23 42: C %9n -1.23 -1.23 43: C %#9n 1.23 1.23 44: C %#9n -1.23 - 1.23 45: C %=*#9n 1.23 ********1.23 46: C %=*#9n -1.23 -********1.23 47: C %-14#5.4n 1.23 " 1.2300 " 48: C %-14#5.4n -1.23 "- 1.2300 " 49: C %-14#5.4n 123.45 " 123.4500 " 50: C %-14#5.4n 123456 " 123456.0000 " 51: # 52: # check both the german locale and strfmon with that data 53: # 54: de_DE.ISO-8859-1 %n 1.23 1,23 EUR 55: de_DE.ISO-8859-1 %n -1.23 -1,23 EUR 56: de_DE.ISO-8859-1 %n 1234.56 1.234,56 EUR 57: de_DE.ISO-8859-1 %12n 123.45 123,45 EUR 58: de_DE.ISO-8859-1 %12n -123.45 -123,45 EUR 59: de_DE.ISO-8859-1 %12n 3456.781 3.456,78 EUR 60: de_DE.ISO-8859-1 %^n 1234.56 1234,56 EUR 61: de_DE.ISO-8859-1 %+n 1234.56 1.234,56 EUR 62: de_DE.ISO-8859-1 %+n -1234.56 -1.234,56 EUR 63: de_DE.ISO-8859-1 %(n 1234.56 1.234,56 EUR 64: de_DE.ISO-8859-1 %(n -1234.56 (1.234,56 EUR) 65: de_DE.ISO-8859-1 %^n 1234.56 1234,56 EUR 66: de_DE.ISO-8859-1 %i 1.23 1,23 EUR 67: de_DE.ISO-8859-1 %i -1.23 -1,23 EUR 68: de_DE.ISO-8859-1 %i 1234.56 1.234,56 EUR 69: de_DE.ISO-8859-1 %^i 1234.56 1234,56 EUR 70: de_DE.ISO-8859-1 %+i 1234.56 1.234,56 EUR 71: de_DE.ISO-8859-1 %+i -1234.56 -1.234,56 EUR 72: de_DE.ISO-8859-1 %(i 1234.56 1.234,56 EUR 73: de_DE.ISO-8859-1 %(i -1234.56 (1.234,56 EUR) 74: de_DE.ISO-8859-1 %^i 1234.56 1234,56 EUR 75: de_DE.ISO-8859-1 %#5n 123.45 123,45 EUR 76: de_DE.ISO-8859-1 %#5n -123.45 - 123,45 EUR 77: de_DE.ISO-8859-1 %#5n 3456.781 3.456,78 EUR 78: de_DE.ISO-8859-1 %=*#5n 123.45 ***123,45 EUR 79: de_DE.ISO-8859-1 %=*#5n -123.45 -***123,45 EUR 80: de_DE.ISO-8859-1 %=*#5n 3456.781 *3.456,78 EUR 81: de_DE.ISO-8859-1 %=0#5n 123.45 000123,45 EUR 82: de_DE.ISO-8859-1 %=0#5n -123.45 -000123,45 EUR 83: de_DE.ISO-8859-1 %=0#5n 3456.781 03.456,78 EUR 84: de_DE.ISO-8859-1 %^#5n 123.45 123,45 EUR 85: de_DE.ISO-8859-1 %^#5n -123.45 - 123,45 EUR 86: de_DE.ISO-8859-1 %^#5n 3456.781 3456,78 EUR 87: de_DE.ISO-8859-1 %^#5.0n 123.45 123 EUR 88: de_DE.ISO-8859-1 %^#5.0n -123.45 - 123 EUR 89: de_DE.ISO-8859-1 %^#5.0n 3456.781 3457 EUR 90: de_DE.ISO-8859-1 %^#5.4n 123.45 123,4500 EUR 91: de_DE.ISO-8859-1 %^#5.4n -123.45 - 123,4500 EUR 92: de_DE.ISO-8859-1 %^#5.4n 3456.781 3456,7810 EUR 93: de_DE.ISO-8859-1 %(#5n 123.45 123,45 EUR 94: de_DE.ISO-8859-1 %(#5n -123.45 ( 123,45 EUR) 95: de_DE.ISO-8859-1 %(#5n 3456.781 3.456,78 EUR 96: de_DE.ISO-8859-1 %!(#5n 123.45 123,45 97: de_DE.ISO-8859-1 %!(#5n -123.45 ( 123,45) 98: de_DE.ISO-8859-1 %!(#5n 3456.781 3.456,78 99: # 100: # check both the en_US locale and strfmon with that data 101: # a lot of this checks are created from a strfmon(3) man-page. 102: # 103: en_US.ISO-8859-1 %n 123.45 $123.45 104: en_US.ISO-8859-1 %n -123.45 -$123.45 105: en_US.ISO-8859-1 %n 3456.781 $3,456.78 106: en_US.ISO-8859-1 %i 123.45 USD 123.45 107: en_US.ISO-8859-1 %i -123.45 -USD 123.45 108: en_US.ISO-8859-1 %i 3456.781 USD 3,456.78 109: en_US.ISO-8859-1 %11n 123.45 $123.45 110: en_US.ISO-8859-1 %11n -123.45 -$123.45 111: en_US.ISO-8859-1 %11n 3456.781 $3,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 $*3,456.78 115: en_US.ISO-8859-1 %=0#5n 123.45 $000123.45 116: en_US.ISO-8859-1 %=0#5n -123.45 -$000123.45 117: en_US.ISO-8859-1 %=0#5n 3456.781 $03,456.78 118: en_US.ISO-8859-1 %^#5n 123.45 $ 123.45 119: en_US.ISO-8859-1 %^#5n -123.45 -$ 123.45 120: en_US.ISO-8859-1 %^#5n 3456.781 $ 3456.78 121: en_US.ISO-8859-1 %^#5.0n 123.45 $ 123 122: en_US.ISO-8859-1 %^#5.0n -123.45 -$ 123 123: en_US.ISO-8859-1 %^#5.0n 3456.781 $ 3457 124: en_US.ISO-8859-1 %^#5.4n 123.45 $ 123.4500 125: en_US.ISO-8859-1 %^#5.4n -123.45 -$ 123.4500 126: en_US.ISO-8859-1 %^#5.4n 3456.781 $ 3456.7810 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 130: en_US.ISO-8859-1 %!(#5n 123.45 123.45 131: en_US.ISO-8859-1 %!(#5n -123.45 ( 123.45) 132: en_US.ISO-8859-1 %!(#5n 3456.781 3,456.78 133: en_US.ISO-8859-1 %#5n 123.45 $ 123.45 134: en_US.ISO-8859-1 %#5n -123.45 -$ 123.45 135: en_US.ISO-8859-1 %#5n 3456.781 $ 3,456.78 136: # 137: # check all cs_precedes/sign_posn/sep_by_space combinations using 138: # special test locales. The six characters after the "_" indicate 139: # these three values for positive and then negative quantities. 140: # 141: tstfmon_n01y12 %n 123.45 123.45 $ 142: tstfmon_n01y12 %n -123.45 - $123.45 143: tstfmon_n01y12 %11n 123.45 123.45 $ 144: tstfmon_n01y12 %11n -123.45 - $123.45 145: tstfmon_n01y12 %^=*#5n 123.45 **123.45 $ 146: tstfmon_n01y12 %^=*#5n -123.45 - $**123.45 147: # 148: tstfmon_n02n40 %n 123.45 123.45$ 149: tstfmon_n02n40 %n -123.45 123.45$- 150: tstfmon_n02n40 %11n 123.45 123.45$ 151: tstfmon_n02n40 %11n -123.45 123.45$- 152: tstfmon_n02n40 %^=*#5n 123.45 **123.45$ 153: tstfmon_n02n40 %^=*#5n -123.45 **123.45$- 154: # 155: tstfmon_n10y31 %n 123.45 +123.45$ 156: tstfmon_n10y31 %n -123.45 -$ 123.45 157: tstfmon_n10y31 %11n 123.45 +123.45$ 158: tstfmon_n10y31 %11n -123.45 -$ 123.45 159: tstfmon_n10y31 %^=*#5n 123.45 +**123.45$ 160: tstfmon_n10y31 %^=*#5n -123.45 -$ **123.45 161: # 162: tstfmon_n11y41 %n 123.45 +123.45 $ 163: tstfmon_n11y41 %n -123.45 $- 123.45 164: tstfmon_n11y41 %11n 123.45 +123.45 $ 165: tstfmon_n11y41 %11n -123.45 $- 123.45 166: tstfmon_n11y41 %^=*#5n 123.45 +**123.45 $ 167: tstfmon_n11y41 %^=*#5n -123.45 $- **123.45 168: # 169: tstfmon_n12y11 %n 123.45 +123.45$ 170: tstfmon_n12y11 %n -123.45 -$ 123.45 171: tstfmon_n12y11 %11n 123.45 +123.45$ 172: tstfmon_n12y11 %11n -123.45 -$ 123.45 173: tstfmon_n12y11 %^=*#5n 123.45 +**123.45$ 174: tstfmon_n12y11 %^=*#5n -123.45 -$ **123.45 175: # 176: tstfmon_n20n32 %n 123.45 123.45$+ 177: tstfmon_n20n32 %n -123.45 123.45- $ 178: tstfmon_n20n32 %11n 123.45 123.45$+ 179: tstfmon_n20n32 %11n -123.45 123.45- $ 180: tstfmon_n20n32 %^=*#5n 123.45 **123.45$+ 181: tstfmon_n20n32 %^=*#5n -123.45 **123.45- $ 182: # 183: tstfmon_n30y20 %n 123.45 123.45+$ 184: tstfmon_n30y20 %n -123.45 $123.45- 185: tstfmon_n30y20 %11n 123.45 123.45+$ 186: tstfmon_n30y20 %11n -123.45 $123.45- 187: tstfmon_n30y20 %^=*#5n 123.45 **123.45+$ 188: tstfmon_n30y20 %^=*#5n -123.45 $**123.45- 189: # 190: tstfmon_n41n00 %n 123.45 123.45 $+ 191: tstfmon_n41n00 %n -123.45 (123.45$) 192: tstfmon_n41n00 %11n 123.45 123.45 $+ 193: tstfmon_n41n00 %11n -123.45 (123.45$) 194: tstfmon_n41n00 %^=*#5n 123.45 **123.45 $+ 195: tstfmon_n41n00 %^=*#5n -123.45 (**123.45$) 196: # 197: tstfmon_y01y10 %n 123.45 $ 123.45 198: tstfmon_y01y10 %n -123.45 -$123.45 199: tstfmon_y01y10 %11n 123.45 $ 123.45 200: tstfmon_y01y10 %11n -123.45 -$123.45 201: tstfmon_y01y10 %^=*#5n 123.45 $ **123.45 202: tstfmon_y01y10 %^=*#5n -123.45 -$**123.45 203: # 204: tstfmon_y02n22 %n 123.45 $123.45 205: tstfmon_y02n22 %n -123.45 123.45$ O/D 206: tstfmon_y02n22 %12n 123.45 $123.45 207: tstfmon_y02n22 %12n -123.45 123.45$ O/D 208: tstfmon_y02n22 %^=*#5n 123.45 $**123.45 209: tstfmon_y02n22 %^=*#5n -123.45 **123.45$ O/D 210: # 211: tstfmon_y22n42 %n 123.45 $123.45+ 212: tstfmon_y22n42 %n -123.45 123.45$ - 213: tstfmon_y22n42 %11n 123.45 $123.45+ 214: tstfmon_y22n42 %11n -123.45 123.45$ - 215: tstfmon_y22n42 %^=*#5n 123.45 $**123.45+ 216: tstfmon_y22n42 %^=*#5n -123.45 **123.45$ - 217: # 218: tstfmon_y30y21 %n 123.45 +$123.45 219: tstfmon_y30y21 %n -123.45 $ 123.45- 220: tstfmon_y30y21 %11n 123.45 +$123.45 221: tstfmon_y30y21 %11n -123.45 $ 123.45- 222: tstfmon_y30y21 %^=*#5n 123.45 +$**123.45 223: tstfmon_y30y21 %^=*#5n -123.45 $ **123.45- 224: # 225: tstfmon_y32n31 %n 123.45 + $123.45 226: tstfmon_y32n31 %n -123.45 123.45 -$ 227: tstfmon_y32n31 %11n 123.45 + $123.45 228: tstfmon_y32n31 %11n -123.45 123.45 -$ 229: tstfmon_y32n31 %^=*#5n 123.45 + $**123.45 230: tstfmon_y32n31 %^=*#5n -123.45 **123.45 -$ 231: # 232: tstfmon_y40y00 %n 123.45 $+123.45 233: tstfmon_y40y00 %n -123.45 ($123.45) 234: tstfmon_y40y00 %11n 123.45 $+123.45 235: tstfmon_y40y00 %11n -123.45 ($123.45) 236: tstfmon_y40y00 %^=*#5n 123.45 $+**123.45 237: tstfmon_y40y00 %^=*#5n -123.45 ($**123.45) 238: # 239: tstfmon_y42n21 %n 123.45 $ +123.45 240: tstfmon_y42n21 %n -123.45 123.45 $- 241: tstfmon_y42n21 %11n 123.45 $ +123.45 242: tstfmon_y42n21 %11n -123.45 123.45 $- 243: tstfmon_y42n21 %^=*#5n 123.45 $ +**123.45 244: tstfmon_y42n21 %^=*#5n -123.45 **123.45 $- 245: # 246: # check all int_cs_precedes/int_sign_posn/int_sep_by_space 247: # combinations using special test locales. The six characters after 248: # the "_" indicate these three values for positive and then negative 249: # quantities. 250: # 251: tstfmon_n01y12 %i 123.45 "123.45 USC" 252: tstfmon_n01y12 %i -123.45 "- USC123.45" 253: tstfmon_n01y12 %13i 123.45 " 123.45 USC" 254: tstfmon_n01y12 %13i -123.45 " - USC123.45" 255: tstfmon_n01y12 %^=*#5i 123.45 " **123.45 USC" 256: tstfmon_n01y12 %^=*#5i -123.45 "- USC**123.45" 257: # 258: tstfmon_n02n40 %i 123.45 "123.45USC" 259: tstfmon_n02n40 %i -123.45 "123.45USC-" 260: tstfmon_n02n40 %13i 123.45 " 123.45USC" 261: tstfmon_n02n40 %13i -123.45 " 123.45USC-" 262: tstfmon_n02n40 %^=*#5i 123.45 "**123.45USC" 263: tstfmon_n02n40 %^=*#5i -123.45 "**123.45USC-" 264: # 265: tstfmon_n10y31 %i 123.45 "+123.45USC" 266: tstfmon_n10y31 %i -123.45 "-USC 123.45" 267: tstfmon_n10y31 %13i 123.45 " +123.45USC" 268: tstfmon_n10y31 %13i -123.45 " -USC 123.45" 269: tstfmon_n10y31 %^=*#5i 123.45 " +**123.45USC" 270: tstfmon_n10y31 %^=*#5i -123.45 "-USC **123.45" 271: # 272: tstfmon_n11y41 %i 123.45 "+123.45 USC" 273: tstfmon_n11y41 %i -123.45 "USC- 123.45" 274: tstfmon_n11y41 %13i 123.45 " +123.45 USC" 275: tstfmon_n11y41 %13i -123.45 " USC- 123.45" 276: tstfmon_n11y41 %^=*#5i 123.45 " +**123.45 USC" 277: tstfmon_n11y41 %^=*#5i -123.45 "USC- **123.45" 278: # 279: tstfmon_n12y11 %i 123.45 "+123.45USC" 280: tstfmon_n12y11 %i -123.45 "-USC 123.45" 281: tstfmon_n12y11 %13i 123.45 " +123.45USC" 282: tstfmon_n12y11 %13i -123.45 " -USC 123.45" 283: tstfmon_n12y11 %^=*#5i 123.45 " +**123.45USC" 284: tstfmon_n12y11 %^=*#5i -123.45 "-USC **123.45" 285: # 286: tstfmon_n20n32 %i 123.45 "123.45USC+" 287: tstfmon_n20n32 %i -123.45 "123.45- USC" 288: tstfmon_n20n32 %13i 123.45 " 123.45USC+" 289: tstfmon_n20n32 %13i -123.45 " 123.45- USC" 290: tstfmon_n20n32 %^=*#5i 123.45 "**123.45USC+" 291: tstfmon_n20n32 %^=*#5i -123.45 "**123.45- USC" 292: # 293: tstfmon_n30y20 %i 123.45 "123.45+USC" 294: tstfmon_n30y20 %i -123.45 "USC123.45-" 295: tstfmon_n30y20 %13i 123.45 " 123.45+USC" 296: tstfmon_n30y20 %13i -123.45 " USC123.45-" 297: tstfmon_n30y20 %^=*#5i 123.45 " **123.45+USC" 298: tstfmon_n30y20 %^=*#5i -123.45 "USC**123.45-" 299: # 300: tstfmon_n41n00 %i 123.45 "123.45 USC+" 301: tstfmon_n41n00 %i -123.45 "(123.45USC)" 302: tstfmon_n41n00 %13i 123.45 " 123.45 USC+" 303: tstfmon_n41n00 %13i -123.45 " (123.45USC)" 304: tstfmon_n41n00 %^=*#5i 123.45 " **123.45 USC+" 305: tstfmon_n41n00 %^=*#5i -123.45 "(**123.45USC)" 306: # 307: tstfmon_y01y10 %i 123.45 "USC 123.45" 308: tstfmon_y01y10 %i -123.45 "-USC123.45" 309: tstfmon_y01y10 %13i 123.45 " USC 123.45" 310: tstfmon_y01y10 %13i -123.45 " -USC123.45" 311: tstfmon_y01y10 %^=*#5i 123.45 "USC **123.45" 312: tstfmon_y01y10 %^=*#5i -123.45 "-USC**123.45" 313: # 314: tstfmon_y02n22 %i 123.45 "USC123.45" 315: tstfmon_y02n22 %i -123.45 "123.45USC O/D" 316: tstfmon_y02n22 %12i 123.45 " USC123.45" 317: tstfmon_y02n22 %12i -123.45 "123.45USC O/D" 318: tstfmon_y02n22 %^=*#5i 123.45 "USC**123.45" 319: tstfmon_y02n22 %^=*#5i -123.45 " **123.45USC O/D" 320: # 321: tstfmon_y22n42 %i 123.45 "USC123.45+" 322: tstfmon_y22n42 %i -123.45 "123.45USC -" 323: tstfmon_y22n42 %13i 123.45 " USC123.45+" 324: tstfmon_y22n42 %13i -123.45 " 123.45USC -" 325: tstfmon_y22n42 %^=*#5i 123.45 "USC**123.45+" 326: tstfmon_y22n42 %^=*#5i -123.45 " **123.45USC -" 327: # 328: tstfmon_y30y21 %i 123.45 "+USC123.45" 329: tstfmon_y30y21 %i -123.45 "USC 123.45-" 330: tstfmon_y30y21 %13i 123.45 " +USC123.45" 331: tstfmon_y30y21 %13i -123.45 " USC 123.45-" 332: tstfmon_y30y21 %^=*#5i 123.45 "+USC**123.45" 333: tstfmon_y30y21 %^=*#5i -123.45 "USC **123.45-" 334: # 335: tstfmon_y32n31 %i 123.45 "+ USC123.45" 336: tstfmon_y32n31 %i -123.45 "123.45 -USC" 337: tstfmon_y32n31 %13i 123.45 " + USC123.45" 338: tstfmon_y32n31 %13i -123.45 " 123.45 -USC" 339: tstfmon_y32n31 %^=*#5i 123.45 "+ USC**123.45" 340: tstfmon_y32n31 %^=*#5i -123.45 " **123.45 -USC" 341: # 342: tstfmon_y40y00 %i 123.45 "USC+123.45" 343: tstfmon_y40y00 %i -123.45 "(USC123.45)" 344: tstfmon_y40y00 %13i 123.45 " USC+123.45" 345: tstfmon_y40y00 %13i -123.45 " (USC123.45)" 346: tstfmon_y40y00 %^=*#5i 123.45 "USC+**123.45" 347: tstfmon_y40y00 %^=*#5i -123.45 "(USC**123.45)" 348: # 349: tstfmon_y42n21 %i 123.45 "USC +123.45" 350: tstfmon_y42n21 %i -123.45 "123.45 USC-" 351: tstfmon_y42n21 %13i 123.45 " USC +123.45" 352: tstfmon_y42n21 %13i -123.45 " 123.45 USC-" 353: tstfmon_y42n21 %^=*#5i 123.45 "USC +**123.45" 354: tstfmon_y42n21 %^=*#5i -123.45 " **123.45 USC-"