Jump to content

Module:ConvertIB/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Hike395 (talk | contribs) at 12:26, 22 June 2024 (more). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:ConvertIB]]. Click talk page to run tests.
local p = require('Module:UnitTests')

-- Example unit test.
function p:test_main()
	self:preprocess_equals_preprocess('{{#invoke:ConvertIB|convert|100|m2||sqft}}', '{{Convert|100|m2|sqft|abbr=on}}')
	self:preprocess_equals_preprocess('{{#invoke:ConvertIB|convert||m2|100|sqft}}', '{{Convert|100|sqft|m2|abbr=on}}')
	self:preprocess_equals_preprocess('{{#invoke:ConvertIB|convert|1000|m||ft}}', '{{Convert|1000|m|ft|abbr=on}}')
	self:preprocess_equals_preprocess('{{#invoke:ConvertIB|convert||m|1000|ft}}', '{{Convert|1000|m|ft|abbr=on}}')
	self:preprocess_equals_preprocess('{{#invoke:ConvertIB|convert}}', '{{Convert|abbr=on}}')
end

return p