| ... | ... | @@ -464,6 +464,15 @@ test "zig fmt: anon literal in array" { |
| 464 | 464 | // ); |
| 465 | 465 | //} |
| 466 | 466 | |
| 467 | test "zig fmt: anon struct literal 0 element" { |
| 468 | try testCanonical( |
| 469 | \\test { |
| 470 | \\ const x = .{}; |
| 471 | \\} |
| 472 | \\ |
| 473 | ); |
| 474 | } |
| 475 | |
| 467 | 476 | test "zig fmt: anon struct literal 1 element" { |
| 468 | 477 | try testCanonical( |
| 469 | 478 | \\test { |
| ... | ... | @@ -527,6 +536,15 @@ test "zig fmt: anon struct literal 3 element comma" { |
| 527 | 536 | ); |
| 528 | 537 | } |
| 529 | 538 | |
| 539 | test "zig fmt: struct literal 0 element" { |
| 540 | try testCanonical( |
| 541 | \\test { |
| 542 | \\ const x = X{}; |
| 543 | \\} |
| 544 | \\ |
| 545 | ); |
| 546 | } |
| 547 | |
| 530 | 548 | test "zig fmt: struct literal 1 element" { |
| 531 | 549 | try testCanonical( |
| 532 | 550 | \\test { |
| ... | ... | @@ -653,6 +671,15 @@ test "zig fmt: anon list literal 3 element comma" { |
| 653 | 671 | ); |
| 654 | 672 | } |
| 655 | 673 | |
| 674 | test "zig fmt: array literal 0 element" { |
| 675 | try testCanonical( |
| 676 | \\test { |
| 677 | \\ const x = [_]u32{}; |
| 678 | \\} |
| 679 | \\ |
| 680 | ); |
| 681 | } |
| 682 | |
| 656 | 683 | test "zig fmt: array literal 1 element" { |
| 657 | 684 | try testCanonical( |
| 658 | 685 | \\test { |