--Go to the talk page to see the results of the tests. See for the content used in testinglocal p = require('Module:UnitTests')local TestPage = "Template:Template parameter value/testpage"
function p:_internal_test(module, name) module.test = function(...) local s,r = module.getValue(...) if not s then return "
--Basic errors tests self:equals(name.."error test 1", module.test, "
--Test _id grabbing for the TemplateN series self:equals(name.."basic grabbing 1", module.test(TestPage, "X13", "_id"), "1") self:equals(name.."basic grabbing 2", module.test(TestPage, "X11", "_id"), "2") self:equals(name.."basic grabbing 3", module.test(TestPage, "X11", "_id",), "2") self:equals(name.."basic grabbing 4", module.test(TestPage, "X12", "_id"), "3") self:equals(name.."basic grabbing 5", module.test(TestPage, "X11", "_id",), "4") self:equals(name.."basic grabbing 6", module.test(TestPage, "X11", "_id",), "5") self:equals(name.."basic grabbing 7", module.test(TestPage, "X11", "_id",), "subtemplate") self:equals(name.."basic grabbing 8", module.test(TestPage, "X11", "_id",), "6") self:equals(name.."basic grabbing 9", module.test(TestPage, "X11", "_id",), "6") --Test grabbing for the other tests (NumericalParameters, HeavyNesting) self:equals(name.."numerical parameters 1", module.test(TestPage, "X21", "1"), "X") self:equals(name.."numerical parameters 2", module.test(TestPage, "X21", "2"), "Y") self:equals(name.."numerical parameters 3", module.test(TestPage, "X21", "3"), "Z") self:equals(name.."numerical parameters 4", module.test(TestPage, "X21", "4"), "W") self:equals(name.."numerical parameters 5", module.test(TestPage, "X21", "5"), "") self:equals(name.."numerical parameters 6", module.test(TestPage, "X21", "6"), "P") self:equals(name.."nesting templates 1", module.test(TestPage, "X22", "1"), "2") self:equals(name.."nesting templates 2", module.test(TestPage, "X22", "1",), "") self:equals(name.."nesting templates 3", module.test(TestPage, "X22", "A1"), "Nest1") self:equals(name.."nesting templates 4", module.test(TestPage, "X22", "A2"), "Nest2 Content",) self:equals(name.."nesting templates 5", module.test(TestPage, "X22", "A3a"), "",) self:equals(name.."nesting templates 6", module.test(TestPage, "X22", "A3b"), "12",) self:equals(name.."nesting templates 7", module.test(TestPage, "X22", "A4",), "A5") self:equals(name.."nesting templates 8", module.test(TestPage, "X22", "A4",), "",) self:equals(name.."nesting templates 9", module.test(TestPage, "X22", "A5"), "") self:equals(name.."nesting templates 10", module.test(TestPage, "X22", "A6"), "") self:equals(name.."nesting templates 11", module.test(TestPage, "X22", "A7"), "",)end
function p:test_live p:_internal_test(require("Module:Template parameter value"), "Live ")end
function p:test_sandbox p:_internal_test(require("Module:Template parameter value/sandbox"), "Sandbox ")end
return p