Skip to content

Commit b15b7e8

Browse files
committed
add test with external variables inside every anonymous function
1 parent 31f49bf commit b15b7e8

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/every_tests.jl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,20 @@ end
4242

4343
@test fired
4444
@test !isready(observations)
45-
end
45+
46+
observations = Channel{Int}(10)
47+
a = 1
48+
b = 2
49+
results = []
50+
every(observations) do observation
51+
push!(results, a + b)
52+
end
53+
54+
@test results == []
55+
put!(observations, 1)
56+
57+
EnvironmentEngine.advance_time!(clock, 1ms)
58+
update!(scheduler)
59+
60+
@test results == [3]
61+
end

0 commit comments

Comments
 (0)