================
@@ -4504,6 +4504,16 @@ TEST_F(FormatTest, FormatsCompactNamespaces) {
                "} // namespace bbbbbb\n"
                "} // namespace aaaaaa",
                Style);
+
+  verifyFormat("namespace a { namespace b { namespace c {\n"
+               "}}} // namespace a::b::c",
+               Style);
+
+  verifyFormat("namespace a { namespace b {\n"
+               "namespace cc {\n"
+               "}}} // namespace a::b::cc",
----------------
galenelias wrote:

I'll defer to your judgement, but I personally think it is helpful to test each 
side of these edge cases around line wrapping.  Having a test to verify things 
don't get wrapped at 'X' columns, but then having tests cases which are like 
X/2 long doesn't really validate the precision of the width calculations, as 
evidenced by this bug, and means we might be wrapping too aggressively, and 
won't catch that via any existing tests.  If we only verify lines significantly 
shorter or longer than the ColumnLimit then we it is easy for mistakes in the 
logic to sneak through.

https://github.com/llvm/llvm-project/pull/105597
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to