Jump to content

Module:Infobox sort/testcases: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Created page with '-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. Click talk page to run tests. local p = require('Module:UnitTests') -- Example unit test. function p:test_desc()...'
 
No edit summary
Line 1: Line 1:
-- Unit tests for [[Module:{{ROOTPAGENAME}}]]. 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')


-- Example unit test.
-- Example unit test.
function p:test_desc()
function p:test_desc()
self:preprocess_equals('{{#invoke:Example | desc | 2% Foo\n3% Bar\n8% Carrot}}', '8% Carrot<br>3% Bar<br>2%Foo')
self:preprocess_equals('{{#invoke:Infobox | desc | 2% Foo\n3% Bar\n8% Carrot}}', '8% Carrot<br>3% Bar<br>2%Foo')
end
end



Revision as of 10:13, 9 June 2020

-- Unit tests for [[Module:Infobox sort]]. Click talk page to run tests.
local p = require('Module:UnitTests')

-- Example unit test.
function p:test_desc()
	self:preprocess_equals('{{#invoke:Infobox | desc | 2% Foo\n3% Bar\n8% Carrot}}', '8% Carrot<br>3% Bar<br>2%Foo')
end

return p