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