csys: recursive-1 test: one more neuron, a sensor as primariy receiver
This commit is contained in:
parent
9392c8c12d
commit
2161242e54
2 changed files with 9 additions and 2 deletions
|
|
@ -162,6 +162,10 @@ defmodule Scopes.CSys.Program do
|
|||
Environ.connect(state, zero, zero, negate())
|
||||
Environ.send_message(state, zero, ~w(csys create succ)a,
|
||||
%{addr: [:csys, :e01, {1, 1}]})
|
||||
end,
|
||||
fn state ->
|
||||
Environ.send_message(state, zero, ~w(csys create pred)a,
|
||||
%{addr: [:csys, :s01, {1, 1}]})
|
||||
end
|
||||
]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ defmodule Scopes.CSysTest do
|
|||
alias Scopes.Shape
|
||||
|
||||
def receive_select(head) do
|
||||
assert_receive {^head, info}
|
||||
assert_receive {^head, info}, 100
|
||||
{head, info}
|
||||
end
|
||||
|
||||
|
|
@ -34,8 +34,11 @@ defmodule Scopes.CSysTest do
|
|||
test "recursive-1" do
|
||||
env = Environ.setup(Program.prepare_basic(), Program.init_recursive_1())
|
||||
Process.sleep(30)
|
||||
Environ.forward_value(env, [:csys, :c00, {0, 0}], 42)
|
||||
Environ.forward_value(env, [:csys, :s01, {1, 1}], 42)
|
||||
assert receive_data().value == 42
|
||||
Environ.forward_value(env, [:csys, :s01, {1, 1}], 47)
|
||||
assert receive_data().value == 5
|
||||
Process.sleep(30)
|
||||
refute_received msg, "unhandled message(s): #{inspect(msg)}"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue