Module:Infobox/testcases: Difference between revisions
Appearance
Content deleted Content added
Added test for ids |
Testcase for infobox with "name" defined |
||
Line 14: | Line 14: | ||
self:preprocess_equals_preprocess_many('{{infobox/sandbox', '}}', '{{Infobox', '}}', { |
self:preprocess_equals_preprocess_many('{{infobox/sandbox', '}}', '{{Infobox', '}}', { |
||
{[=[ |
{[=[ |
||
|label2 = Label 2 |
|||
|labelid2 = lable |
|||
|data2 = Data 2 |
|||
|dataid2 = data |
|||
|rowid1 = row |
|||
|header1 = Header 1 |
|||
|headerid1 = header |
|||
]=]}, |
|||
}, {nowiki = 'yes'}) |
|||
end |
|||
function p:test_ids_name() |
|||
self:preprocess_equals_preprocess_many('{{infobox/sandbox', '}}', '{{Infobox', '}}', { |
|||
{[=[ |
|||
|name = qwertz |
|||
|label2 = Label 2 |
|label2 = Label 2 |
||
|labelid2 = lable |
|labelid2 = lable |
Revision as of 15:40, 7 July 2014
![]() | This is the test cases page for the module Module:Infobox. Results of the test cases. |
-- Example Unit tests for [[Module:Bananas]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_hello()
self:preprocess_equals_preprocess_many('{{infobox/sandbox', '}}', '{{Infobox', '}}', {
{[=[
|label1 = Label 1
|data1 = Data 1
]=]},
}, {nowiki = 'yes'})
end
function p:test_ids()
self:preprocess_equals_preprocess_many('{{infobox/sandbox', '}}', '{{Infobox', '}}', {
{[=[
|label2 = Label 2
|labelid2 = lable
|data2 = Data 2
|dataid2 = data
|rowid1 = row
|header1 = Header 1
|headerid1 = header
]=]},
}, {nowiki = 'yes'})
end
function p:test_ids_name()
self:preprocess_equals_preprocess_many('{{infobox/sandbox', '}}', '{{Infobox', '}}', {
{[=[
|name = qwertz
|label2 = Label 2
|labelid2 = lable
|data2 = Data 2
|dataid2 = data
|rowid1 = row
|header1 = Header 1
|headerid1 = header
]=]},
}, {nowiki = 'yes'})
end
return p