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

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 3 13:20:15 PST 2022


Mordante added a comment.

Thanks for this improvement, please update the summary.
In general LGTM, but I would like to consider the duplication before approving.



================
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);
----------------
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.)



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