Jump to content

Module:Infobox road/color/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Happy5214 (talk | contribs) at 14:45, 15 March 2013 (Adding basic tests). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
-- Unit tests for [[Module:Infobox road/color]]. Click talk page to run tests.
local p = require('Module:UnitTests')

function p:test_General()
    self:preprocess_equals('{{Infobox road/meta/colors|country=USA|header_type=hist}}', 'background:#704214; color:white;')
    self:preprocess_equals('{{Infobox road/meta/colors|country=USA|header_type=former}}', 'background:#AAA;')
end

function p:test_USA()
    self:preprocess_equals('{{Infobox road/meta/colors|country=USA}}', 'background:#006A4D; color:white;')
    self:preprocess_equals('{{Infobox road/meta/colors|country=USA|type=Park}}', 'background:#704214; color:white;')
    self:preprocess_equals('{{Infobox road/meta/colors|country=USA|type=FFH}}', 'background:#704214; color:white;')
end

return p