summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-11-18 09:35:16 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2011-11-18 09:35:16 +0100
commit1019f4b28b768085db2f78dac2a3d2f54a8e541f (patch)
tree23a5b1a2240634c4d0a47c0306267ce29df77513
parent3deeedbf4fb944dfd9f4a903ba924356a8df9c91 (diff)
downloadlua-file-magic-1019f4b28b768085db2f78dac2a3d2f54a8e541f.tar.bz2
lua-file-magic-1019f4b28b768085db2f78dac2a3d2f54a8e541f.tar.xz
Add simple test script
-rw-r--r--test.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test.lua b/test.lua
new file mode 100644
index 0000000..83331a7
--- /dev/null
+++ b/test.lua
@@ -0,0 +1,16 @@
+#!/usr/bin/lua
+
+magic = require("magic")
+
+m = magic.open()
+
+assert(m:load())
+
+print(m:errno())
+print(m:file("Makefile"))
+
+m:setflags(magic.MIME_TYPE)
+print(m:error())
+
+print(m:file("Makefile"))
+