Module:Infobox sort/testcases: Difference between revisions
Appearance
Content deleted Content added
No edit summary |
Add asc test |
||
Line 1: | Line 1: | ||
-- Unit tests for [[Module:Infobox sort]]. Click talk page to run tests. |
-- Unit tests for [[Module:Infobox sort]]. Click talk page to run tests. |
||
local p = require('Module:UnitTests') |
local p = require('Module:UnitTests') |
||
function p:test_asc() |
|||
self:preprocess_equals('{{#invoke:Infobox sort | asc | 8% Foo | 3% Bar | 4% Carrot}}', '3% Bar<br>4% Carrot<br>8% Foo') |
|||
end |
|||
function p:test_desc() |
function p:test_desc() |
Latest revision as of 11:02, 9 June 2020
![]() | This is the test cases page for the module Module:Infobox sort. Results of the test cases. |
-- Unit tests for [[Module:Infobox sort]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_asc()
self:preprocess_equals('{{#invoke:Infobox sort | asc | 8% Foo | 3% Bar | 4% Carrot}}', '3% Bar<br>4% Carrot<br>8% Foo')
end
function p:test_desc()
self:preprocess_equals('{{#invoke:Infobox sort | desc | 2% Foo | 3% Bar | 8% Carrot}}', '8% Carrot<br>3% Bar<br>2% Foo')
end
function p:test_desc_missing_param()
self:preprocess_equals('{{#invoke:Infobox sort | desc | {{#if: | 2% Foo}} | 3% Bar | 8% Carrot}}', '8% Carrot<br>3% Bar')
end
return p