zig fmt: don't delete container doc comments

Fixes #12617
This commit is contained in:
yujiri8
2022-09-02 14:12:20 -04:00
committed by GitHub
parent 4a08c6dd51
commit 10e11b60e5
2 changed files with 21 additions and 3 deletions

View File

@@ -5057,6 +5057,21 @@ test "zig fmt: make single-line if no trailing comma" {
);
}
test "zig fmt: preserve container doc comment in container without trailing comma" {
try testTransform(
\\const A = enum(u32) {
\\//! comment
\\_ };
\\
,
\\const A = enum(u32) {
\\ //! comment
\\ _,
\\};
\\
);
}
test "zig fmt: make single-line if no trailing comma" {
try testCanonical(
\\// Test trailing comma syntax