aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-02-23 14:30:21 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-02-23 14:30:21 -0700
commitca9259340d42d92c8e44cb814effae447ee64a24 (patch)
treec730c3a8501f3ccadfba1859e1ac0cc0816d7557
parentf041425e48b2f65fd4262d3c9ba210c410322d02 (diff)
downloadzig-ca9259340d42d92c8e44cb814effae447ee64a24.tar.gz
zig-ca9259340d42d92c8e44cb814effae447ee64a24.zip
zig fmt now intentionally respects all empty line comments
-rw-r--r--lib/std/zig/parser_test.zig24
1 files changed, 9 insertions, 15 deletions
diff --git a/lib/std/zig/parser_test.zig b/lib/std/zig/parser_test.zig
index 76d3985576..3fd7fbdb74 100644
--- a/lib/std/zig/parser_test.zig
+++ b/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(