Module:Infobox dim/testcases: Difference between revisions

Content deleted Content added
test zoom
adjust to match new parameters
 
(17 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_preprocess_many(
{'length_km=20|width_km=30','150000'},
'{{#invoke:Infobox dim | scale |','}}','{{#invoke:Infobox dim/sandbox | scale |','}}',{
{'length_kmlength_mi=20|width_kmwidth_mi=30','241401'},
{'length_miwidth_km=20|width_milength_km=30','150000'},
{'width_kmwidth_mi=20|length_kmlength_mi=30','241401'},
{'width_milength_km=20|length_mi=30','100000'},
{'length_kmlength_mi=20','160934'},
{'length_miwidth_km=2030','150000'},
{'width_kmwidth_mi=30','241401'},
{'width_miarea_km2=30300','180999'},
{'area_km2area_mi2=300200','237838'},
{'area_mi2area_ha=20030,000','180999'},
{'area_haarea_acre=3075,000','182056'},
{'area_acredim=7550km',000'500000'},
{'dim=50km25000km','200000000'},
{'dim=100','1600'},
{'scale=100000'},
{'typescale=mountain100000','100000'},
{'type=city|population=mountain','100000'},
{'type=mountain|length_kmwidth_km=20no','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_preprocess_many(
{'length_km=20|width_km=30','9'},
'{{#invoke:Infobox dim | zoom |','}}','{{#invoke:Infobox dim/sandbox | zoom |','}}',{
{'length_kmlength_mi=20|width_kmwidth_mi=30','8'},
{'length_miwidth_km=20|width_milength_km=30','9'},
{'width_kmwidth_mi=20|length_kmlength_mi=30','8'},
{'width_milength_km=20|length_mi=30','10'},
{'length_kmlength_mi=20','9'},
{'length_miwidth_km=2030','9'},
{'width_kmwidth_mi=30','8'},
{'width_miarea_km2=30300','9'},
{'area_km2area_mi2=300200','9'},
{'area_mi2area_ha=20030,000','9'},
{'area_haarea_acre=3075,000','9'},
{'area_acredim=7550km',000'8'},
{'dim=50km25000km','1'},
{'dim=100','17'},
{'scale=100000'},
{'typescale=mountain100000','12'},
{'type=city|population=100000mountain','10'},
{'type=mountain|length_kmwidth_km=20no','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