[libcxx-commits] [PATCH] D120889: [libcxx] [test] Fix the get/put long_double_zh_CN tests on Windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 3 13:54:12 PST 2022


mstorsjo added inline comments.


================
Comment at: libcxx/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_zh_CN.pass.cpp:149
         std::string ex(str, iter.base());
-        assert(ex == "\xEF\xBF\xA5""-1,234,567.89    ");
+        assert(ex == currency_symbol + "-1,234,567.89" + std::string(7 - currency_symbol.size(), ' '));
         assert(ios.width() == 0);
----------------
Mordante wrote:
> I'm not too fond of `std::string(7 - currency_symbol.size(), ' ')` duplicated a lot of times.
> @Quuxplusone, @mstorsjo How about making one padding variable without 20 in the name and use that?
> (I know Arthur asked this change, just want to confirm both of you like the way it looks now.)
> 
I'm totally ok with e.g. `std::string currency_symbol_padding = std::string(7 - currency_symbol.size(), ' ');` and using that instead - that would indeed make it less cluttered. (That's what I would prefer here actually, but I'm ok with whatever you guys prefer.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120889/new/

https://reviews.llvm.org/D120889



More information about the libcxx-commits mailing list