mirror of
https://github.com/Oreolek/ink-instead.git
synced 2024-07-08 01:24:39 +03:00
24 lines
489 B
Lua
24 lines
489 B
Lua
|
local luaunit = require('luaunit')
|
||
|
local parser = require('peg')
|
||
|
|
||
|
|
||
|
function testText() doTestS("Hello world", {{"para", "Hello world"}}) end
|
||
|
function testDev() doTest('dev') end
|
||
|
|
||
|
|
||
|
|
||
|
-----------------------------
|
||
|
|
||
|
function doTestS(ink, expected)
|
||
|
luaunit.assertEquals(parser:match(ink), expected)
|
||
|
end
|
||
|
|
||
|
function doTest(name)
|
||
|
local test = require ('test.'..name)
|
||
|
local parsed = parser:match(test.ink)
|
||
|
luaunit.assertEquals(parsed, test.expected)
|
||
|
end
|
||
|
|
||
|
os.exit( luaunit.LuaUnit.run() )
|
||
|
|