zig fmt: implement catch and return

This commit is contained in:
Isaac Freund
2021-02-07 14:37:12 +01:00
committed by Andrew Kelley
parent 0929fcbc34
commit bb7b5ee2ac
3 changed files with 51 additions and 40 deletions

View File

@@ -2622,18 +2622,22 @@ test "zig fmt: ptr deref operator and unwrap optional operator" {
// \\
// );
//}
//
//test "zig fmt: catch" {
// try testCanonical(
// \\test "catch" {
// \\ const a: anyerror!u8 = 0;
// \\ _ = a catch return;
// \\ _ = a catch |err| return;
// \\}
// \\
// );
//}
//
test "zig fmt: catch" {
try testCanonical(
\\test "catch" {
\\ const a: anyerror!u8 = 0;
\\ _ = a catch return;
\\ _ = a catch
\\ return;
\\ _ = a catch |err| return;
\\ _ = a catch |err|
\\ return;
\\}
\\
);
}
//test "zig fmt: blocks" {
// try testCanonical(
// \\test "blocks" {