mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
fixed tests being in the wrong files
This commit is contained in:
parent
8aefe88104
commit
bc0e8773d2
2 changed files with 19 additions and 19 deletions
|
@ -41,21 +41,29 @@ end)
|
||||||
task.wait()
|
task.wait()
|
||||||
assert(flag3 == 3, "Defer should run after spawned threads")
|
assert(flag3 == 3, "Defer should run after spawned threads")
|
||||||
|
|
||||||
-- Delay should be able to be nested
|
-- Defer should be able to be nested
|
||||||
|
|
||||||
local flag4: boolean = false
|
local flag4: boolean = false
|
||||||
task.delay(0.05, function()
|
task.defer(function()
|
||||||
local function nested3()
|
local function nested3()
|
||||||
task.delay(0.05, function()
|
task.defer(function()
|
||||||
|
task.wait(0.05)
|
||||||
flag4 = true
|
flag4 = true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
local function nested2()
|
local function nested2()
|
||||||
task.delay(0.05, nested3)
|
task.defer(function()
|
||||||
|
task.wait(0.05)
|
||||||
|
nested3()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
local function nested1()
|
local function nested1()
|
||||||
task.delay(0.05, nested2)
|
task.defer(function()
|
||||||
|
task.wait(0.05)
|
||||||
|
nested2()
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
task.wait(0.05)
|
||||||
nested1()
|
nested1()
|
||||||
end)
|
end)
|
||||||
task.wait(0.25)
|
task.wait(0.25)
|
||||||
|
|
|
@ -28,33 +28,25 @@ assert(flag, "Delay should work with yielding (1)")
|
||||||
task.wait(0.1)
|
task.wait(0.1)
|
||||||
assert(not flag2, "Delay should work with yielding (2)")
|
assert(not flag2, "Delay should work with yielding (2)")
|
||||||
|
|
||||||
-- Defer should be able to be nested
|
-- Delay should be able to be nested
|
||||||
|
|
||||||
local flag4: boolean = false
|
local flag4: boolean = false
|
||||||
task.defer(function()
|
task.delay(0.05, function()
|
||||||
local function nested3()
|
local function nested3()
|
||||||
task.defer(function()
|
task.delay(0.05, function()
|
||||||
task.wait(0.05)
|
|
||||||
flag4 = true
|
flag4 = true
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
local function nested2()
|
local function nested2()
|
||||||
task.defer(function()
|
task.delay(0.05, nested3)
|
||||||
task.wait(0.05)
|
|
||||||
nested3()
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
local function nested1()
|
local function nested1()
|
||||||
task.defer(function()
|
task.delay(0.05, nested2)
|
||||||
task.wait(0.05)
|
|
||||||
nested2()
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
task.wait(0.05)
|
|
||||||
nested1()
|
nested1()
|
||||||
end)
|
end)
|
||||||
task.wait(0.25)
|
task.wait(0.25)
|
||||||
assert(flag4, "Defer should work with nesting")
|
assert(flag4, "Delay should work with nesting")
|
||||||
|
|
||||||
-- Varargs should get passed correctly
|
-- Varargs should get passed correctly
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue