[libcxx-commits] [libcxx] [libcxx] Provide locale conversions to tests through lit substitution (PR #105651)

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 17 12:59:33 PDT 2024


================
@@ -80,6 +49,12 @@ std::wstring negate_en_US(std::wstring s) {
 #endif
 }
 
+wchar_t thousands_sep_or_default(std::wstring s) { return !s.empty() ? s[0] : L','; }
----------------
mstorsjo wrote:

You mean, that rather than the individual tests doing `const wchar_t fr_sep = LocaleHelpers::mon_thousands_sep_or_default(FR_MON_THOU_SEP);`, we'd just go `const wchar_t fr_sep = FR_MON_THOU_SEP;`?

I'm not entirely sure of the original author's intentions here, but I would guess that this felt like a smaller step - in case we didn't manage to dig up the right separators in the test framework. But as long as that setup does work (and afaik it does), I guess we could get rid of the defaults in `locale_helpers.h` entirely.

https://github.com/llvm/llvm-project/pull/105651


More information about the libcxx-commits mailing list