From 30c4add85a0f4af727ad7cf8f2134114329d0f07 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 11 Jul 2018 20:17:47 -0400 Subject: [PATCH] std.event.Future: workaround in tests for llvm coro memory See #1194 --- std/event.zig | 2 +- std/event/future.zig | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/std/event.zig b/std/event.zig index f3913a432b..1e52086286 100644 --- a/std/event.zig +++ b/std/event.zig @@ -4,7 +4,7 @@ pub const Lock = @import("event/lock.zig").Lock; pub const tcp = @import("event/tcp.zig"); pub const Channel = @import("event/channel.zig").Channel; pub const Group = @import("event/group.zig").Group; -pub const Future = @import("event/future.zig").Group; +pub const Future = @import("event/future.zig").Future; test "import event tests" { _ = @import("event/locked.zig"); diff --git a/std/event/future.zig b/std/event/future.zig index 6c03641828..b6ec861f77 100644 --- a/std/event/future.zig +++ b/std/event/future.zig @@ -67,6 +67,9 @@ test "std.event.Future" { } async fn testFuture(loop: *Loop) void { + suspend |p| { + resume p; + } var future = Future(i32).init(loop); const a = async waitOnFuture(&future) catch @panic("memory"); @@ -79,10 +82,16 @@ async fn testFuture(loop: *Loop) void { } async fn waitOnFuture(future: *Future(i32)) i32 { + suspend |p| { + resume p; + } return (await (async future.get() catch @panic("memory"))).*; } async fn resolveFuture(future: *Future(i32)) void { + suspend |p| { + resume p; + } future.data = 6; future.resolve(); }