Module:Adjacent stations/testcases
Appearance
![]() | This is the test cases page for the module Module:Adjacent stations. Results of the test cases. |
-- Unit tests for [[Module:Adjacent stations]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test_01_icon()
self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {
--{'Taipei|R', ''},
-- Icon for system with icon
{'system=MTR', '[[File:HK MTR logo (PD).svg|x14px|link=MTR|alt=MTR]]'},
{'MTR', '[[File:HK MTR logo (PD).svg|x14px|link=MTR|alt=MTR]]'},
-- Icon for system without icon
{'system=San Diego Trolley', ''},
{'San Diego Trolley', ''},
-- Icon for line with icon format
{'system=MTR|line=Island', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]]'},
{'MTR|Island', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]]'},
-- Icon for line with icon format using alias
{'system=MTR|line=isl', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]]'},
{'MTR|isl', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]]'},
-- Icon for line with icon
{'system=San Diego Trolley|line=Green', '[[File:San Diego Trolley Green Line.svg|16px]]'},
{'San Diego Trolley|Green', '[[File:San Diego Trolley Green Line.svg|16px]]'},
-- Icon for type with icon and name
{'system=Taoyuan Metro|line=Airport|type=Commuter', '[[File:Taoyuan Metro Line Airport.svg|18px|link=Taoyuan Airport MRT]]'},
{'Taoyuan Metro|Airport|Commuter', '[[File:Taoyuan Metro Line Airport.svg|18px|link=Taoyuan Airport MRT]]'},
-- Icon for system with icon and name
{'system=MTR|name=y', '[[File:HK MTR logo (PD).svg|x14px|link=MTR|alt=MTR]] [[MTR]]'},
{'MTR|name=y', '[[File:HK MTR logo (PD).svg|x14px|link=MTR|alt=MTR]] [[MTR]]'},
-- Icon for system without icon and name
{'system=San Diego Trolley|name=y', '[[San Diego Trolley]]'},
{'San Diego Trolley|name=y', '[[San Diego Trolley]]'},
-- Icon for line with icon format and name
{'system=MTR|line=Island|name=y', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]] [[Island line (MTR)|Island line]]'},
{'MTR|Island|name=y', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]] [[Island line (MTR)|Island line]]'},
-- Icon for line with icon format and name using alias
{'system=MTR|line=isl|name=y', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]] [[Island line (MTR)|Island line]]'},
{'MTR|isl|name=y', '[[Island line (MTR)|<span style="background-color:#007dc5;border:1px solid #000"> </span>]] [[Island line (MTR)|Island line]]'},
-- Icon for line with icon and name
{'system=San Diego Trolley|line=Green|name=y', '[[File:San Diego Trolley Green Line.svg|16px]] [[Green Line (San Diego Trolley)|Green Line]]'},
{'San Diego Trolley|Green|name=y', '[[File:San Diego Trolley Green Line.svg|16px]] [[Green Line (San Diego Trolley)|Green Line]]'},
-- Icon for type with icon and name
{'system=Taoyuan Metro|line=Airport|type=Commuter|name=y', '[[File:Taoyuan Metro Line Airport.svg|18px|link=Taoyuan Airport MRT]] [[Taoyuan Airport MRT]]'},
{'Taoyuan Metro|Airport|Commuter|name=y', '[[File:Taoyuan Metro Line Airport.svg|18px|link=Taoyuan Airport MRT]] [[Taoyuan Airport MRT]]'},
-- _default icon for lines
{'Antwerp tram|1', '[[File:DeLijn icon 1antw.svg|16px|alt=]]'},
-- _default icon for lines using alias
{'Antwerp tram|line 1', '[[File:DeLijn icon 1antw.svg|16px|alt=]]'},
-- Override _default icon for lines with icon specified
{'São Paulo Metropolitan Trains|13-AE', '[[File:Cptm 13.svg|16px|alt=]]'},
-- Sole line default
{'Taiwan High Speed Rail', '[[File:Taiwan High Speed Rail Logo(Log Only).svg|18px|link=Taiwan High Speed Rail|alt=Taiwan High Speed Rail]]'},
})
end
return p