diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-05-13 12:24:41 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2017-05-13 12:24:41 +0100 |
commit | 52d0418b0a71c9c9a0d16140e59f43193331208a (patch) | |
tree | b2d08318ad33240aa29ff67050135999587d93f4 | |
parent | 7ccfa7a6f2d2f5d4b98bdc2035b11512c136e039 (diff) | |
download | lace-dsilvers/definechecking.tar.gz |
Test that include statements error on bad condition namesdsilvers/definechecking
-rw-r--r-- | test/test-lace.builtin.lua | 9 |
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") |