Message ID | 1780055980.914645.1559776082012@poczta.nazwa.pl |
---|---|
State | New |
Headers | show |
Series | nl_NL locale: Correct the negative monetary format (bug 24614). | expand |
* Rafal Luzynski: > diff --git a/stdlib/tst-strfmon_l.c b/stdlib/tst-strfmon_l.c > index a193ed6787..7f0f6d47d5 100644 > --- a/stdlib/tst-strfmon_l.c > +++ b/stdlib/tst-strfmon_l.c > @@ -216,6 +216,19 @@ static const struct locale_pair tests[] = > } > } > }, > + { > + "nl_NL.UTF-8", > + { > + { > + "EUR 1\u202f234\u202f567,89", "\u20ac 1\u202f234\u202f567,89", > + "EUR 1234567,89", "\u20ac 1234567,89" > + }, > + { > + "EUR -1\u202f234\u202f567,89", "\u20ac -1\u202f234\u202f567,89", > + "EUR -1234567,89", "\u20ac -1234567,89", > + } > + } > + }, > {} > }; Originally, this test was intended as a test for strfmon_l, in particular that the locale argument controls all aspects of the formatting, and not just a subset. It is not a general-purpose locale test. For locale testing, we should perhaps iterate through all supported locales and check against test expectations for number and money formatting. I don't think we do that today. Thanks, Florian
7.06.2019 09:58 Florian Weimer <fweimer@redhat.com> wrote: > > * Rafal Luzynski: > > > diff --git a/stdlib/tst-strfmon_l.c b/stdlib/tst-strfmon_l.c > > index a193ed6787..7f0f6d47d5 100644 > > --- a/stdlib/tst-strfmon_l.c > > +++ b/stdlib/tst-strfmon_l.c > > @@ -216,6 +216,19 @@ static const struct locale_pair tests[] = > > [...] > > Originally, this test was intended as a test for strfmon_l, in > particular that the locale argument controls all aspects of the > formatting, and not just a subset. It is not a general-purpose locale > test. Thank you for this feedback, I did not know. > For locale testing, we should perhaps iterate through all supported > locales and check against test expectations for number and money > formatting. I don't think we do that today. There is another test program: localedata/tst-strfmon1.c. I thought that those two should be merged but now I guess that you would prefer to have the test case added to localedata/tst-strfmon1.c instead of to stdlib/tst-strfmon_l.c. I don't think we are going to test *all* locales. The collation tests are huge and cover many locales but definitely not all. Regards, Rafal
diff --git a/localedata/locales/nl_NL b/localedata/locales/nl_NL index 1ab3277aa0..d0ba6c7283 100644 --- a/localedata/locales/nl_NL +++ b/localedata/locales/nl_NL @@ -83,9 +83,9 @@ frac_digits 2 p_cs_precedes 1 p_sep_by_space 1 n_cs_precedes 1 -n_sep_by_space 1 +n_sep_by_space 2 p_sign_posn 1 -n_sign_posn 2 +n_sign_posn 4 END LC_MONETARY LC_NUMERIC diff --git a/stdlib/Makefile b/stdlib/Makefile index 32f6050ecc..8521e68107 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -171,7 +171,7 @@ include ../Rules ifeq ($(run-built-tests),yes) LOCALES := cs_CZ.UTF-8 de_DE.UTF-8 en_US.ISO-8859-1 tr_TR.UTF-8 \ tr_TR.ISO-8859-9 tg_TJ.UTF-8 hr_HR.UTF-8 hi_IN.UTF-8 \ - el_GR.UTF-8 + el_GR.UTF-8 nl_NL.UTF-8 include ../gen-locales.mk $(objpfx)bug-strtod2.out: $(gen-locales) diff --git a/stdlib/tst-strfmon_l.c b/stdlib/tst-strfmon_l.c index a193ed6787..7f0f6d47d5 100644 --- a/stdlib/tst-strfmon_l.c +++ b/stdlib/tst-strfmon_l.c @@ -216,6 +216,19 @@ static const struct locale_pair tests[] = } } }, + { + "nl_NL.UTF-8", + { + { + "EUR 1\u202f234\u202f567,89", "\u20ac 1\u202f234\u202f567,89", + "EUR 1234567,89", "\u20ac 1234567,89" + }, + { + "EUR -1\u202f234\u202f567,89", "\u20ac -1\u202f234\u202f567,89", + "EUR -1234567,89", "\u20ac -1234567,89", + } + } + }, {} };