Lua tests (#158)

* Fix float comparison in tests

* Lua tests
This commit is contained in:
Gawaboumga
2018-01-31 15:27:23 +01:00
committed by Jérôme Leclercq
parent 7c1ffea19c
commit dfd28160a0
9 changed files with 595 additions and 5 deletions

View 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

View 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