committed by
Jérôme Leclercq
parent
7c1ffea19c
commit
dfd28160a0
24
tests/resources/Engine/Lua/LuaClass.lua
Normal file
24
tests/resources/Engine/Lua/LuaClass.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
function test_Test()
|
||||
local test = Test(1)
|
||||
|
||||
local i = test:GetI()
|
||||
local result = Test.StaticMethodWithArguments(i, i)
|
||||
local finalTest = Test(result + test:GetDefault(), true)
|
||||
|
||||
CheckTest(test)
|
||||
CheckStatic(result)
|
||||
CheckFinalTest(finalTest)
|
||||
end
|
||||
|
||||
function test_InheritTest()
|
||||
local test = InheritTest()
|
||||
|
||||
CheckInheritTest(test)
|
||||
end
|
||||
|
||||
function test_TestHandle()
|
||||
local test = TestHandle()
|
||||
|
||||
CheckTestHandle()
|
||||
end
|
||||
15
tests/resources/Engine/Lua/LuaCoroutine.lua
Normal file
15
tests/resources/Engine/Lua/LuaCoroutine.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
function even (x)
|
||||
coroutine.yield(1)
|
||||
end
|
||||
|
||||
function odd (x)
|
||||
coroutine.yield(0)
|
||||
end
|
||||
|
||||
function infinite (x)
|
||||
for i=1,x do
|
||||
if i==3 then coroutine.yield(-1) end
|
||||
if i % 2 == 0 then even(i) else odd(i) end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user