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:31, 17 April 2021 (Created page with '-- Unit tests for Module:ParameterCount. Click talk page to run tests. local p = require('Module:UnitTests') function p:test_main() self:preprocess_equa...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- Unit tests for [[Module:ParameterCount]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_main()
    self:preprocess_equals_all('{{#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