Update tests

Added a case to confirm the behavior of strict mode's double evaluation
and node cached values.
This commit is contained in:
Aaron Smith 2023-09-27 10:24:14 +01:00
parent d07c705b64
commit 2ae65a0194

View file

@ -2019,6 +2019,22 @@ TEST("strict", wrap_root(function()
CHECK(ok) CHECK(ok)
end end
do CASE "effect counter"
local src = source(true)
local count = 0
effect(function(x: number)
src()
count = x + 1
return count
end, count)
CHECK(count == 2)
src(not src())
CHECK(count == 4)
end
end)) end))
local ok = FINISH() local ok = FINISH()