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