1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
local tests = {}
describe("Initializeing tests",function()
local testnames = {
{"forinloop.lua", "forin loops"},
{"fornumloop.lua","fornum loops"},
{"invoke.lua","invokes"},
{"call.lua","calls"},
{"string.lua","strings"},
}
for k,v in pairs(testnames) do
local file = io.open("./tests/"..v[1],"r")
tests[v[2]] = file:read("*a")
end
end)
describe("GLuM should", function()
local glum
it("initialize without error",function()
glum = dofile("../src/glum.lua")
end)
describe("output non-erroring minified code for",function()
for k,v in pairs(tests) do
it(k,function()
local miniftxt = glum.minify(v)
local minified = loadstring(miniftxt)
assert.has_no.errors(minified)
end)
end
end)
end)
|