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,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