zig fmt: add more test cases

master
Andrew Kelley 2019-08-16 10:11:53 -04:00
parent 2151f84d59
commit 7874d5a40b
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,18 @@ test "zig fmt: change use to usingnamespace" {
);
}
test "zig fmt: async function" {
try testCanonical(
\\pub const Server = struct {
\\ handleRequestFn: async fn (*Server, *const std.net.Address, File) void,
\\};
\\test "hi" {
\\ var ptr = @ptrCast(async fn (i32) void, other);
\\}
\\
);
}
test "zig fmt: whitespace fixes" {
try testTransform("test \"\" {\r\n\tconst hi = x;\r\n}\n// zig fmt: off\ntest \"\"{\r\n\tconst a = b;}\r\n",
\\test "" {