From 0063953d1634ce770ce88519c66e3956832ceb7e Mon Sep 17 00:00:00 2001 From: Vexu <15308111+Vexu@users.noreply.github.com> Date: Thu, 27 Jun 2019 00:30:34 +0300 Subject: [PATCH] added better test cases --- std/zig/parser_test.zig | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/std/zig/parser_test.zig b/std/zig/parser_test.zig index 876d84e173..404c82e9b8 100644 --- a/std/zig/parser_test.zig +++ b/std/zig/parser_test.zig @@ -2265,6 +2265,16 @@ test "zig fmt: line comment in array" { \\} \\ ); + try testCanonical( + \\test "a" { + \\ var arr = [_]u32{ + \\ 0, + \\ // 1, + \\ // 2, + \\ }; + \\} + \\ + ); } test "zig fmt: comment after params" { @@ -2282,6 +2292,14 @@ test "zig fmt: comment after params" { \\) void {} \\ ); + try testCanonical( + \\fn a( + \\ b: u32, + \\ // c: u32, + \\ // d: u32, + \\) void {} + \\ + ); } test "zig fmt: comment in array initializer/access" {