fmt: support trailing comma after var_args

This commit is contained in:
Shritesh Bhattarai
2019-04-05 11:25:32 -05:00
committed by Andrew Kelley
parent 6cc2d3938e
commit 2f236e6efb
2 changed files with 23 additions and 2 deletions

View File

@@ -354,6 +354,15 @@ test "zig fmt: fn decl with trailing comma" {
);
}
test "zig fmt: var_args with trailing comma" {
try testCanonical(
\\pub fn add(
\\ a: ...,
\\) void {}
\\
);
}
test "zig fmt: enum decl with no trailing comma" {
try testTransform(
\\const StrLitKind = enum {Normal, C};