Commit ca9259340d

Andrew Kelley <andrew@ziglang.org>
2021-02-23 22:30:21
zig fmt now intentionally respects all empty line comments
1 parent f041425
Changed files (1)
lib
lib/std/zig/parser_test.zig
@@ -3447,21 +3447,15 @@ test "zig fmt: file ends with struct field" {
     );
 }
 
-// TODO intentionally change the behavior of this case?
-// for array literals we necessarily have meaningful empty comments
-//test "zig fmt: comment after empty comment" {
-//    try testTransform(
-//        \\const x = true; //
-//        \\//
-//        \\//
-//        \\//a
-//        \\
-//    ,
-//        \\const x = true;
-//        \\//a
-//        \\
-//    );
-//}
+test "zig fmt: comment after empty comment" {
+    try testCanonical(
+        \\const x = true; //
+        \\//
+        \\//
+        \\//a
+        \\
+    );
+}
 
 test "zig fmt: line comment in array" {
     try testTransform(