Jump to content

Module:Infobox/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Pppery (talk | contribs) at 19:14, 12 September 2020 (Pppery changed the content model of the page Module:Infobox/testcases from "Scribunto" to "wikitext": Blanking and redirecting to Template:Infobox/testcases where there are much more detailled tests; these contain almost no meaningful content.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

function p:test_hello()

   self:preprocess_equals_preprocess_many('Template:Infobox/sandbox', '', 'Template:Infobox', '', {
       {[=[
           |label1  = Label 1
           |data1   = Data 1
       ]=]},
   }, {nowiki = 'yes'})

end

function p:test_ids()

   self:preprocess_equals_preprocess_many('Template:Infobox/sandbox', '', 'Template: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('Template:Infobox/sandbox', '', 'Template:Infobox', '', {
       {[=[
           |name      = qw er tz
           |label2    = Label 2
           |labelid2  = lable
           |data2     = Data 2
           |dataid2   = data
           |rowid1    = row
           |header1   = Header 1
           |headerid1 = header
       ]=]},
   }, {nowiki = 'yes'})

end

return p