[libcxx-commits] [libcxx] [libc++][test] Adjust expected hexfloat format (PR #95011)

David Tenty via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 18 08:26:48 PDT 2024


================
@@ -49,6 +48,13 @@ class my_numpunct
     virtual std::string do_grouping() const {return std::string("\1\2\3");}
 };
 
+const std::string hexfloat_fmt(const double& v, const std::ios& ios){
----------------
daltenty wrote:

Generating the expected output for the locale facets this way kind of negates the value of these tests, because it introduces a circular dependency.  

The ostringstream, etc. you use here will use the locale facets to generate the expected output, which is the used to test ... the locale facets. 

So did we really test the expect behaviour? Even if the output contains garbage it could match (because both sides would contain the same garbage).


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


More information about the libcxx-commits mailing list