From a69c69bb722408bd5112ca2683f2044bcb1e2635 Mon Sep 17 00:00:00 2001 From: Thomas Harning Jr Date: Mon, 18 Apr 2016 10:00:25 -0400 Subject: [PATCH] tests: adds multiple registered calls and nested calls to enhance test coverage --- tests/lunit-calls.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/lunit-calls.lua b/tests/lunit-calls.lua index b20a857..460e3f0 100644 --- a/tests/lunit-calls.lua +++ b/tests/lunit-calls.lua @@ -106,11 +106,23 @@ end function test_permitted() local strict = { calls = { - defs = { call = true } + defs = { call = true, other = true } } } local decoder = json.decode.getDecoder(strict) assert(decoder("call(1)").name == 'call') + assert(decoder("other(1)").name == 'other') +end + +function test_permitted_nested() + local strict = { + calls = { + defs = { call = true, other = true } + } + } + local decoder = json.decode.getDecoder(strict) + assert(decoder("call(call(1))").name == 'call') + assert(decoder("other(call(1))").name == 'other') end function test_not_defined_fail() -- 2.11.4.GIT