Jump to content

Module:ParameterCount/testcases: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
fix
oops, not a valid testing method here
Line 5: Line 5:
self:preprocess_equals_many('{{#invoke:ParameterCount|all|', '}}', {
self:preprocess_equals_many('{{#invoke:ParameterCount|all|', '}}', {
{'', '0'},
{'', '0'},
-- TODO: arguments from parent template cannot be tested here
{'A', '1'},
{'k=v', '1'},
{'A|B', '2'},
{'A|k=v', '2'},
{'k=v|A', '2'},
{'A|B|C', '3'},
{'A|B|k=v', '3'},
{'1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40', '40'},
})
})
end
end

Revision as of 16:45, 17 April 2021

-- Unit tests for [[Module:ParameterCount]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_all()
    self:preprocess_equals_many('{{#invoke:ParameterCount|all|', '}}', {
    	{'', '0'},
    	-- TODO: arguments from parent template cannot be tested here
    })
end

return p