zig fmt: for loop with ptr payload and index

This commit is contained in:
Andrew Kelley
2021-02-23 18:33:13 -07:00
parent 988f1c6a6f
commit 4420fe97be
2 changed files with 15 additions and 3 deletions

View File

@@ -4152,6 +4152,18 @@ test "zig fmt: space after top level doc comment" {
);
}
test "zig fmt: for loop with ptr payload and index" {
try testCanonical(
\\test {
\\ for (self.entries.items) |*item, i| {}
\\ for (self.entries.items) |*item, i|
\\ a = b;
\\ for (self.entries.items) |*item, i| a = b;
\\}
\\
);
}
test "zig fmt: error for invalid bit range" {
try testError(
\\var x: []align(0:0:0)u8 = bar;