diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-05-13 19:42:24 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-05-13 19:42:24 +0100 |
commit | b61d840109f44692312ba952db009adba76fa727 (patch) | |
tree | e852379881cb986e9028049db1b42efe54a8bf6d | |
parent | e73d054eab36b6f7e34c85826be5490ed31f5e78 (diff) | |
download | lace-b61d840109f44692312ba952db009adba76fa727.tar.gz |
Verify reasons for compilation failures make their way back to the caller
-rw-r--r-- | test/test-lace.compile-denynoreason.rules | 3 | ||||
-rw-r--r-- | test/test-lace.compiler.lua | 6 |
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") |