| ... | ... | @@ -1,3 +1,12 @@ |
| 1 | test "zig fmt: aggregate type init with only 1 field" { |
| 2 | try testCanonical( |
| 3 | \\comptime { |
| 4 | \\ assert(bar(Payload {.A = 1234}) == -10); |
| 5 | \\} |
| 6 | \\ |
| 7 | ); |
| 8 | } |
| 9 | |
| 1 | 10 | test "zig fmt: union(enum(u32)) with assigned enum values" { |
| 2 | 11 | try testCanonical( |
| 3 | 12 | \\const MultipleChoice = union(enum(u32)) { |
| ... | ... | @@ -709,9 +718,7 @@ test "zig fmt: switch" { |
| 709 | 718 | \\ Float: f64, |
| 710 | 719 | \\ }; |
| 711 | 720 | \\ |
| 712 | | \\ const u = Union { |
| 713 | | \\ .Int = 0, |
| 714 | | \\ }; |
| 721 | \\ const u = Union {.Int = 0}; |
| 715 | 722 | \\ switch (u) { |
| 716 | 723 | \\ Union.Int => |int| {}, |
| 717 | 724 | \\ Union.Float => |*float| unreachable, |
| ... | ... | @@ -1029,6 +1036,7 @@ test "zig fmt: struct literals with fields on each line" { |
| 1029 | 1036 | try testCanonical( |
| 1030 | 1037 | \\var self = BufSet { |
| 1031 | 1038 | \\ .hash_map = BufSetHashMap.init(a), |
| 1039 | \\ .hash_map2 = xyz, |
| 1032 | 1040 | \\}; |
| 1033 | 1041 | \\ |
| 1034 | 1042 | ); |