Module:Debug/testcases

-- Needs more tests local suite = require("Dev:ScribuntoUnit/sandbox"):new local dbgModule = require("Dev:Debug") local childArgs = {[1]="childArg1",["arg2"] ="childArg2"} local parentArgs = {[1]="parentArg1",["arg2"] ="parentArg2"}

function suite:test_childArgs local frame = dbgModule.frame(childArgs) self:assertDeepEquals(frame.args,childArgs,"Child arguments are not correct") end

function suite:test_parentArgs local frame = dbgModule.frame(nil,parentArgs) self:assertDeepEquals(frame:getParent.args,parentArgs,"Parent arguments are not correct") end

function suite:test_get_Parent_Child_Args local frame = dbgModule.frame(childArgs, parentArgs) self:assertDeepEquals(frame.args,childArgs,"Child arguments are not correct") self:assertDeepEquals(frame:getParent.args,parentArgs,"Parent arguments are not correct") end

function suite:test_no_Parent_Child_Args local frame = dbgModule.frame self:assertDeepEquals(frame.args,{},"Child arguments are not correct") self:assertDeepEquals(frame:getParent.args,{},"Parent arguments are not correct") end

function suite:test_invoke_getParent_twice local frame = dbgModule.frame self:assertEquals(frame:getParent:getParent,nil,"Grandparent should be nil") end

return suite