More parameter verb-call checks

Signed-off-by: Rahix <rahix@rahix.de>
dev
rahix 7 years ago
parent dc0e021ef6
commit 9c32c826ea
Signed by: rahix
GPG Key ID: E3435E19257D6FCB

@ -64,9 +64,14 @@ function test_call_verb()
end
function test_multinode_call_verb()
local bc1 = bc:init({["light0"]=true}, {["toggle_light0"]=function(b)
local bc1 = bc:init({["light0"]=true}, {
["toggle_light0"]=function(b)
b:set_noun("light0", not b:get_noun("light0"))
end})
end,
["set_light0"]=function(b, state)
b:set_noun("light0", state)
end,
})
local a1 = network.get_scene()
local bc2 = bc:init({}, {})
local a2 = network.get_scene()
@ -80,6 +85,15 @@ function test_multinode_call_verb()
network.set_scene(a1)
assert_equal(true, bc1:get_noun("light0"), "Second verb invocation did not go to plan")
-- Check calling with parameter
for _, b in pairs({true, false}) do
network.set_scene(a2)
assert_true(bc2:call_verb("set_light0", b))
network.set_scene(a1)
assert_equal(b, bc1:get_noun("light0"), "Parameter verb invocation did not go to plan")
end
end
function test_multinode_get_noun()

Loading…
Cancel
Save