Module:Infobox dim/testcases: Difference between revisions

Content deleted Content added
hardwire values
adjust to match new parameters
 
(16 intermediate revisions by the same user not shown)
Line 4:
-- Test dim
function p:test_dim()
self:preprocess_equals_manypreprocess_equals_sandbox_many('{{#invoke:Infobox dim | dim |','}}dim', {
{'length_km=20|width_km=30','15km'},
{'length_mi=20|width_mi=30','24km'},
Line 13:
{'width_km=30','15km'},
{'width_mi=30','24km'},
{'area_km2=300','17km18km'},
{'area_mi2=200','22km24km'},
{'area_ha=30,000','17km18km'},
{'area_acre=75,000','17km18km'},
{'dim=50km','50km'},
{'scale=100000','24km10km'},
{'type=mountain','24km10km'},
{'type=citymountain|populationwidth_km=100000no','11km10km'},
{'type=mountaincity|length_kmpopulation=20100000','10km12km'},
{'type=mountain|length_km=20','10km'},
{'length_km=20|viewport_cm=25','8km'},
{'length_km=20|viewport_px=800','8km'},
{'area_ha=blerg',''},
{'',''}
})
self:preprocess_equals('{{#invoke:Infobox dim | dim }}','')
end
 
-- Test scale
function p:test_scale()
self:preprocess_equals_sandbox_many('{{#invoke:Infobox dim','scale', {
self:preprocess_equals_many(
{'length_km=20|width_km=30','150000'},
'{{#invoke:Infobox dim | scale |','}}',{
{'length_kmlength_mi=20|width_kmwidth_mi=30',62500'241401'},
{'length_miwidth_km=20|width_milength_km=30',100584'150000'},
{'width_kmwidth_mi=20|length_kmlength_mi=30',62500'241401'},
{'width_milength_km=20|length_mi=30',100584'100000'},
{'length_kmlength_mi=20',41667'160934'},
{'length_miwidth_km=2030',67056'150000'},
{'width_kmwidth_mi=30',62500'241401'},
{'width_miarea_km2=30300',100584'180999'},
{'area_km2area_mi2=300200',70509'237838'},
{'area_mi2area_ha=20030,000',92650'180999'},
{'area_haarea_acre=3075,000',70509'182056'},
{'area_acredim=75,00050km',70921'500000'},
{'dim=50km25000km',208333'200000000'},
{'dim=100','1600'},
{'scale=100000',100000},
{'typescale=mountain100000','100000'},
{'type=city|population=100000mountain',47013'100000'},
{'type=mountain|length_kmwidth_km=20no',41667'100000'} ,
{'type=city|population=100000','117907'},
{'type=mountain|length_km=20','100000'},
{'length_km=20|viewport_cm=25','80000'},
{'length_km=20|viewport_px=800','83333'},
{'area_ha=blerg',''},
{'',''}
})
self:preprocess_equals('{{#invoke:Infobox dim | scale}}','')
end
 
-- Test zoom
function p:test_zoom()
self:preprocess_equalspreprocess_equals_sandbox_many('{{#invoke:Infobox dim | dim }}','zoom'), {
self:preprocess_equals_many(
{'length_km=20|width_km=30','9'},
'{{#invoke:Infobox dim | zoom |','}}',{
{'length_kmlength_mi=20|width_kmwidth_mi=30',13'8'},
{'length_miwidth_km=20|width_milength_km=30',12'9'},
{'width_kmwidth_mi=20|length_kmlength_mi=30',13'8'},
{'width_milength_km=20|length_mi=30',12'10'},
{'length_kmlength_mi=20',14'9'},
{'length_miwidth_km=2030',13'9'},
{'width_kmwidth_mi=30',13'8'},
{'width_miarea_km2=30300',12'9'},
{'area_km2area_mi2=300200',13'9'},
{'area_mi2area_ha=20030,000',12'9'},
{'area_haarea_acre=3075,000',13'9'},
{'area_acredim=75,00050km',13'8'},
{'dim=50km25000km',11'1'},
{'scaledim=100000100',12'17'},
{'typescale=mountain100000','12'},
{'type=city|population=100000mountain',13'10'},
{'type=mountain|length_kmwidth_km=20no',14'10'} ,
{'type=city|population=100000','10'},
{'type=mountain|length_km=20','10'},
{'length_km=20|viewport_cm=25','12'},
{'length_km=20|viewport_px=800','12'},
{'area_ha=blerg',''},
{'',''}
})
self:preprocess_equals('{{#invoke:Infobox dim | zoom}}','')
end