summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-05-13 12:24:41 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-05-13 12:24:41 +0100
commit52d0418b0a71c9c9a0d16140e59f43193331208a (patch)
treeb2d08318ad33240aa29ff67050135999587d93f4
parent7ccfa7a6f2d2f5d4b98bdc2035b11512c136e039 (diff)
downloadlace-dsilvers/definechecking.tar.gz
Test that include statements error on bad condition namesdsilvers/definechecking
-rw-r--r--test/test-lace.builtin.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/test-lace.builtin.lua b/test/test-lace.builtin.lua
index 62d42a5..9f5f4f9 100644
--- a/test/test-lace.builtin.lua
+++ b/test/test-lace.builtin.lua
@@ -358,6 +358,15 @@ function suite.compile_include_statement_noname()
assert(msg.msg:match("ruleset name"), "Expected error should mention a lack of name")
end
+function suite.compile_include_statement_unknowncond()
+ local compctx = {_lace = {}}
+ local cmdtab, msg = builtin.commands.include(compctx, "include", "whatever", "badcond")
+ assert(cmdtab == false, "Internal errors should return false")
+ assert(type(msg) == "table", "Internal errors should return tables")
+ assert(type(msg.msg) == "string", "Internal errors should have string messages")
+ assert(msg.msg:match("badcond"), "Expected error should mention the bad condition")
+end
+
function suite.compile_include_statement_noloader()
local compctx = {_lace = {}}
local cmdtab, msg = builtin.commands.include(compctx, "include", "fish")