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" {...@@ -111,12 +111,12 @@ test "@frameSize" {
111 const S = struct {111 const S = struct {
112 fn doTheTest() void {112 fn doTheTest() void {
113 {113 {
114 var ptr = @ptrCast(async fn(i32) void, other);114 var ptr = @ptrCast(async fn (i32) void, other);
115 const size = @frameSize(ptr);115 const size = @frameSize(ptr);
116 expect(size == @sizeOf(@Frame(other)));116 expect(size == @sizeOf(@Frame(other)));
117 }117 }
118 {118 {
119 var ptr = @ptrCast(async fn() void, first);119 var ptr = @ptrCast(async fn () void, first);
120 const size = @frameSize(ptr);120 const size = @frameSize(ptr);
121 expect(size == @sizeOf(@Frame(first)));121 expect(size == @sizeOf(@Frame(first)));
122 }122 }
...@@ -431,7 +431,7 @@ test "heap allocated async function frame" {...@@ -431,7 +431,7 @@ test "heap allocated async function frame" {
431test "async function call return value" {431test "async function call return value" {
432 const S = struct {432 const S = struct {
433 var frame: anyframe = undefined;433 var frame: anyframe = undefined;
434 var pt = Point{.x = 10, .y = 11 };434 var pt = Point{ .x = 10, .y = 11 };
435435
436 fn doTheTest() void {436 fn doTheTest() void {
437 expectEqual(pt.x, 10);437 expectEqual(pt.x, 10);
...@@ -568,7 +568,6 @@ test "await inside an errdefer" {...@@ -568,7 +568,6 @@ test "await inside an errdefer" {
568 frame = @frame();568 frame = @frame();
569 suspend;569 suspend;
570 }570 }
571
572 };571 };
573 S.doTheTest();572 S.doTheTest();
574}573}
...@@ -632,10 +631,10 @@ test "returning a const error from async function" {...@@ -632,10 +631,10 @@ test "returning a const error from async function" {
632}631}
633632
634test "async/await typical usage" {633test "async/await typical usage" {
635 inline for ([_]bool{false, true}) |b1| {634 inline for ([_]bool{ false, true }) |b1| {
636 inline for ([_]bool{false, true}) |b2| {635 inline for ([_]bool{ false, true }) |b2| {
637 inline for ([_]bool{false, true}) |b3| {636 inline for ([_]bool{ false, true }) |b3| {
638 inline for ([_]bool{false, true}) |b4| {637 inline for ([_]bool{ false, true }) |b4| {
639 testAsyncAwaitTypicalUsage(b1, b2, b3, b4).doTheTest();638 testAsyncAwaitTypicalUsage(b1, b2, b3, b4).doTheTest();
640 }639 }
641 }640 }
...@@ -647,8 +646,8 @@ fn testAsyncAwaitTypicalUsage(...@@ -647,8 +646,8 @@ fn testAsyncAwaitTypicalUsage(
647 comptime simulate_fail_download: bool,646 comptime simulate_fail_download: bool,
648 comptime simulate_fail_file: bool,647 comptime simulate_fail_file: bool,
649 comptime suspend_download: bool,648 comptime suspend_download: bool,
650 comptime suspend_file: bool) type649 comptime suspend_file: bool,
651{650) type {
652 return struct {651 return struct {
653 fn doTheTest() void {652 fn doTheTest() void {
654 _ = async amainWrap();653 _ = async amainWrap();