parser: port test "rewrite callconv(.@\"inline\") to the inline keyword"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-02-10 18:22:37 +00:00
parent ebda1c03bd
commit 854f1157c4

View File

@@ -568,6 +568,20 @@ test "zig fmt: tuple struct" {
); );
} }
test "zig fmt: rewrite callconv(.@\"inline\") to the inline keyword" {
try testTransform(
\\fn foo() callconv(.@"inline") void {}
\\const bar: @import("std").builtin.CallingConvention = .@"inline";
\\fn foo() callconv(bar) void {}
\\
,
\\inline fn foo() void {}
\\const bar: @import("std").builtin.CallingConvention = .@"inline";
\\fn foo() callconv(bar) void {}
\\
);
}
test "zig fmt: respect line breaks in struct field value declaration" { test "zig fmt: respect line breaks in struct field value declaration" {
try testCanonical( try testCanonical(
\\const Foo = struct { \\const Foo = struct {