Jump to content

Module:ParameterCount/testcases: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
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...'
 
fix
Line 2: Line 2:
local p = require('Module:UnitTests')
local p = require('Module:UnitTests')


function p:test_main()
function p:test_all()
self:preprocess_equals_all('{{#invoke:ParameterCount|all|', '}}', {
self:preprocess_equals_many('{{#invoke:ParameterCount|all|', '}}', {
{'', '0'},
{'', '0'},
{'A', '1'},
{'A', '1'},

Revision as of 16:33, 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'},
    	{'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