Jump to content

Module:ParameterCount/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by MarioGom (talk | contribs) at 16:33, 17 April 2021 (fix). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- 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'},
    	{'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

return p