authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-16 10:13:40-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-08-16 10:13:40-04:00
log49c88e23af6fe1dc895544f91231cc3b53110c8e
tree9ac5f8a00a3a4026fb3d69173369cf5d329cd3af
parent7874d5a40b5ab4bd94ffbf5ecf5935d707a28942
signaturelock-open Commit is signed but in an unrecognized format.

zig fmt


1 files changed, 9 insertions(+), 10 deletions(-)

test/stage1/behavior/async_fn.zig+9-10
......@@ -111,12 +111,12 @@ test "@frameSize" {
111111 const S = struct {
112112 fn doTheTest() void {
113113 {
114 var ptr = @ptrCast(async fn(i32) void, other);
114 var ptr = @ptrCast(async fn (i32) void, other);
115115 const size = @frameSize(ptr);
116116 expect(size == @sizeOf(@Frame(other)));
117117 }
118118 {
119 var ptr = @ptrCast(async fn() void, first);
119 var ptr = @ptrCast(async fn () void, first);
120120 const size = @frameSize(ptr);
121121 expect(size == @sizeOf(@Frame(first)));
122122 }
......@@ -431,7 +431,7 @@ test "heap allocated async function frame" {
431431test "async function call return value" {
432432 const S = struct {
433433 var frame: anyframe = undefined;
434 var pt = Point{.x = 10, .y = 11 };
434 var pt = Point{ .x = 10, .y = 11 };
435435
436436 fn doTheTest() void {
437437 expectEqual(pt.x, 10);
......@@ -568,7 +568,6 @@ test "await inside an errdefer" {
568568 frame = @frame();
569569 suspend;
570570 }
571
572571 };
573572 S.doTheTest();
574573}
......@@ -632,10 +631,10 @@ test "returning a const error from async function" {
632631}
633632
634633test "async/await typical usage" {
635 inline for ([_]bool{false, true}) |b1| {
636 inline for ([_]bool{false, true}) |b2| {
637 inline for ([_]bool{false, true}) |b3| {
638 inline for ([_]bool{false, true}) |b4| {
634 inline for ([_]bool{ false, true }) |b1| {
635 inline for ([_]bool{ false, true }) |b2| {
636 inline for ([_]bool{ false, true }) |b3| {
637 inline for ([_]bool{ false, true }) |b4| {
639638 testAsyncAwaitTypicalUsage(b1, b2, b3, b4).doTheTest();
640639 }
641640 }
......@@ -647,8 +646,8 @@ fn testAsyncAwaitTypicalUsage(
647646 comptime simulate_fail_download: bool,
648647 comptime simulate_fail_file: bool,
649648 comptime suspend_download: bool,
650 comptime suspend_file: bool) type
651{
649 comptime suspend_file: bool,
650) type {
652651 return struct {
653652 fn doTheTest() void {
654653 _ = async amainWrap();