Skip to content

Commit be5557f

Browse files
committed
properly crash runner_task in tests. tests for async_map
1 parent 1fcb7d9 commit be5557f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

test/async.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
facts("Async") do
3+
4+
context("async_map") do
5+
x = Input(1)
6+
t, y = async_map(-, 0, x)
7+
8+
@fact value(t) --> nothing
9+
@fact value(y) --> 0
10+
11+
push!(x, 2)
12+
step()
13+
step()
14+
15+
@fact value(y) --> -2
16+
end
17+
end

test/runtests.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ using Reactive
22

33
# Stop the runner task
44
try
5-
throwto(Reactive.runner_task, InterruptException())
5+
println("Killing ", Reactive.runner_task) # the task switch caused here is required!
6+
Base.throwto(Reactive.runner_task, InterruptException())
67
catch
78
end
89

@@ -11,4 +12,5 @@ include("basics.jl")
1112
include("call_count.jl")
1213
include("flatten.jl")
1314
include("time.jl")
15+
include("async.jl")
1416
FactCheck.exitstatus()

0 commit comments

Comments
 (0)