Jump to content

Module:ParameterCount/testcases: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
oops, not a valid testing method here
No edit summary
Line 3: Line 3:


function p:test_all()
function p:test_all()
self:preprocess_equals_many('{{#invoke:ParameterCount|all|', '}}', {
self:preprocess_equals_many('{{#invoke:ParameterCount/sandbox|all|', '}}', {
{'', '0'},
{'', '0'},
{'1', '1'},
-- TODO: arguments from parent template cannot be tested here
{'A', '1'},
{'1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20', '20'},
{'|1| | |4|5|6|7|8|9|10', '8'},
{'checkblanks=no|1| | |4|5|6|7|8|9|10', '10'},
})
})
end
end

Revision as of 10:08, 27 February 2023

-- 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/sandbox|all|', '}}', {
    	{'', '0'},
    	{'1', '1'},
    	{'A', '1'},
    	{'1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20', '20'},
    	{'|1| | |4|5|6|7|8|9|10', '8'},
     	{'checkblanks=no|1| | |4|5|6|7|8|9|10', '10'},
    })
end

return p