Jump to content

Module:Road data/size/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by BrandonXLF (talk | contribs) at 18:14, 26 August 2024 (Add testcases). 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:{{ROOTPAGENAME}}]]. Click talk page to run tests.
local p = require('Module:UnitTests')
local sandbox = require('Module:Road data/size/sandbox')

function p:test_size_wikitext()
	self:preprocess_equals('{{#invoke:Road data/size/sandbox|size|style=jct}}', '24px')
end

function p:test_size_lua()
	self:equals('Basic call', sandbox._size{style='infobox'}, '72px')
end

function p:test_ignoreUpright_lua()
	self:equals('Do ignore', sandbox._ignoreUpright('rdt'), true)
	self:equals('Do not ignore', sandbox._ignoreUpright('infobox'), false)
end

return p