[libcxx] [test] Fix the monetary locale pos/neg_format test for Windows and macOS
authorMartin Storsjö <martin@martin.st>
Tue, 18 Jan 2022 09:20:04 +0000 (09:20 +0000)
committerMartin Storsjö <martin@martin.st>
Sun, 27 Feb 2022 19:49:14 +0000 (21:49 +0200)
commitf1d0d6f70c63a465c102742c7b910cc201a9502e
tree606768e529845b23609342a7b6ff20e471adad0d
parentf6cb59d35f8c5cb3ce8658474c6379ae534195fe
[libcxx] [test] Fix the monetary locale pos/neg_format test for Windows and macOS

The zh_CN.UTF-8 locale on Glibc has got `n_sign_posn == 4` (which means
having the negative sign just after the currency symbol), but has
`int_n_sign_posn == 1` (which means before the string).

On Windows, there's no separate `int_n_sign_posn` field, so the same
`n_sign_posn` (which is 4 there too) is used for international currency
formatting too. This makes the ordering for the international case on
Windows be the same as for the national one right above it.

On Apple platforms, the fr_FR.UTF-8 locale has got `n_sign_posn == 2`
but `p_sign_posn == 1`, giving a different order for the French locale
for the negative format.

On Apple platforms for the zh_CN.UTF-8 locale, both `n_sign_posn` and
`int_n_sign_posn` are 4, but `p_sign_posn` and `int_p_sign_posn` are 1.

Differential Revision: https://reviews.llvm.org/D120550
libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/neg_format.pass.cpp
libcxx/test/std/localization/locale.categories/category.monetary/locale.moneypunct.byname/pos_format.pass.cpp