mirror of
https://gitlab.com/luk3yx/minetest-flow.git
synced 2025-09-28 09:36:30 +02:00
Fix unit test
This commit is contained in:
parent
8f0d86a53a
commit
0b25461948
8
test.lua
8
test.lua
@ -1134,16 +1134,16 @@ describe("Flow", function()
|
|||||||
end)
|
end)
|
||||||
it("updates flow.get_context", function()
|
it("updates flow.get_context", function()
|
||||||
local form = flow.make_gui(function()
|
local form = flow.make_gui(function()
|
||||||
assert.equals(flow.get_context().value, "inner")
|
assert.equals("inner", flow.get_context().value)
|
||||||
return gui.Label{label = "Hello"}
|
return gui.Label{label = "Hello"}
|
||||||
end)
|
end)
|
||||||
test_render(function(p, ctx)
|
test_render(function(p, ctx)
|
||||||
ctx.value = "outer"
|
ctx.value = "outer"
|
||||||
ctx.inner = {value = "inner"}
|
ctx.test = {value = "inner"}
|
||||||
|
|
||||||
assert.equals(flow.get_context().value, "outer")
|
assert.equals("outer", flow.get_context().value)
|
||||||
local embedded = form:embed{player = p, name = "test"}
|
local embedded = form:embed{player = p, name = "test"}
|
||||||
assert.equals(flow.get_context().value, "outer")
|
assert.equals("outer", flow.get_context().value)
|
||||||
return embedded
|
return embedded
|
||||||
end, gui.Label{label = "Hello"})
|
end, gui.Label{label = "Hello"})
|
||||||
end)
|
end)
|
||||||
|
Loading…
Reference in New Issue
Block a user