aboutsummaryrefslogtreecommitdiff
path: root/test/glum_spec.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-07-01 22:08:45 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-07-01 22:08:45 -0400
commit774b296d3e49b8be3b0feaee8b5d3154fcec73b6 (patch)
treee076254b6332c177dc34b4d87bc222f52ca49646 /test/glum_spec.lua
downloadglum-774b296d3e49b8be3b0feaee8b5d3154fcec73b6.tar.gz
glum-774b296d3e49b8be3b0feaee8b5d3154fcec73b6.tar.bz2
glum-774b296d3e49b8be3b0feaee8b5d3154fcec73b6.zip
Initial commit
Diffstat (limited to 'test/glum_spec.lua')
-rw-r--r--test/glum_spec.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/glum_spec.lua b/test/glum_spec.lua
new file mode 100644
index 0000000..e4c5749
--- /dev/null
+++ b/test/glum_spec.lua
@@ -0,0 +1,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)