From ca9259340d42d92c8e44cb814effae447ee64a24 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 23 Feb 2021 14:30:21 -0700 Subject: zig fmt now intentionally respects all empty line comments --- lib/std/zig/parser_test.zig | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'lib/std') 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( -- cgit v1.2.3