summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/test-lace.compile-denynoreason.rules3
-rw-r--r--test/test-lace.compiler.lua6
2 files changed, 9 insertions, 0 deletions
diff --git a/test/test-lace.compile-denynoreason.rules b/test/test-lace.compile-denynoreason.rules
new file mode 100644
index 0000000..be156bd
--- /dev/null
+++ b/test/test-lace.compile-denynoreason.rules
@@ -0,0 +1,3 @@
+-- This rule will fail to compile because deny was not given a reason
+
+deny
diff --git a/test/test-lace.compiler.lua b/test/test-lace.compiler.lua
index 7b1c641..5c5c843 100644
--- a/test/test-lace.compiler.lua
+++ b/test/test-lace.compiler.lua
@@ -116,6 +116,12 @@ function suite.load_file_with_disabled_command()
assert(msg:match("is disabled by"), "Error returned did not match the bad command")
end
+function suite.load_file_with_bad_deny_command()
+ local result, msg = compiler.compile(comp_context, "denynoreason")
+ assert(result == false, "Internal errors should return false")
+ assert(msg:match("got nothing"), "Error returned did not match expected behaviour from deny")
+end
+
function suite.load_file_with_one_command()
local result, msg = compiler.compile(comp_context, "denyall")
assert(type(result) == "table", "Loading a ruleset should result in a table")