authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-02-23 19:40:34+01:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2021-02-23 19:40:34+01:00
logabfe21383035522945e52ffb3954c03398767a39
tree54622ce1a4251767c172132b00b2d2724d770839
parent6b9f19a6449b0fe5dce835590fcd6d13b5c785c4
signaturelock-open Commit is signed but in an unrecognized format.

zig fmt: enable array init trailing comment insertion test

Modify the test case slightly to match similar modifications done in 5820bd0 and 0f24b61.

1 files changed, 31 insertions(+), 30 deletions(-)

lib/std/zig/parser_test.zig+31-30
......@@ -3463,36 +3463,37 @@ test "zig fmt: file ends with struct field" {
34633463// );
34643464//}
34653465
3466//test "zig fmt: line comment in array" {
3467// try testTransform(
3468// \\test "a" {
3469// \\ var arr = [_]u32{
3470// \\ 0
3471// \\ // 1,
3472// \\ // 2,
3473// \\ };
3474// \\}
3475// \\
3476// ,
3477// \\test "a" {
3478// \\ var arr = [_]u32{
3479// \\ 0, // 1,
3480// \\ // 2,
3481// \\ };
3482// \\}
3483// \\
3484// );
3485// try testCanonical(
3486// \\test "a" {
3487// \\ var arr = [_]u32{
3488// \\ 0,
3489// \\ // 1,
3490// \\ // 2,
3491// \\ };
3492// \\}
3493// \\
3494// );
3495//}
3466test "zig fmt: line comment in array" {
3467 try testTransform(
3468 \\test "a" {
3469 \\ var arr = [_]u32{
3470 \\ 0
3471 \\ // 1,
3472 \\ // 2,
3473 \\ };
3474 \\}
3475 \\
3476 ,
3477 \\test "a" {
3478 \\ var arr = [_]u32{
3479 \\ 0,
3480 \\ // 1,
3481 \\ // 2,
3482 \\ };
3483 \\}
3484 \\
3485 );
3486 try testCanonical(
3487 \\test "a" {
3488 \\ var arr = [_]u32{
3489 \\ 0,
3490 \\ // 1,
3491 \\ // 2,
3492 \\ };
3493 \\}
3494 \\
3495 );
3496}
34963497
34973498test "zig fmt: comment after params" {
34983499 try testTransform(