mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 12:59:04 +00:00
add zig fmt test for upgrading for loop syntax
This commit is contained in:
parent
aeaef8c0ff
commit
a005b5f198
@ -1,3 +1,23 @@
|
||||
// TODO: remove this after zig 0.11.0 is released
|
||||
test "zig fmt: transform old for loop syntax to new" {
|
||||
try testTransform(
|
||||
\\fn foo() void {
|
||||
\\ for (a) |b, i| {
|
||||
\\ _ = b; _ = i;
|
||||
\\ }
|
||||
\\}
|
||||
\\
|
||||
,
|
||||
\\fn foo() void {
|
||||
\\ for (a, 0..) |b, i| {
|
||||
\\ _ = b;
|
||||
\\ _ = i;
|
||||
\\ }
|
||||
\\}
|
||||
\\
|
||||
);
|
||||
}
|
||||
|
||||
test "zig fmt: tuple struct" {
|
||||
try testCanonical(
|
||||
\\const T = struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user