Module:Adjacent stations/testcases

-- Unit tests for Module:Adjacent stations. Click talk page to run tests.

--[[

When adding new tests make sure to test all possible combinations.

A system can have one line or many;

A line can have one type, many or none;

A system or line can use defaults;

A line or type can use a title with or without a short name;

A system, line, or type can use an icon or an icon format or can not use any;

]]--

local p = require('Module:UnitTests')

function p:test_01_icon()

self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {

-- Icon for a system with an icon. Use .

{'system=testcases/Test module', 'File:HK MTR logo (PD).svg'},

{'testcases/Test module', 'File:HK MTR logo (PD).svg'},

-- Icon for a system without an icon. Show no icon.

{'system=San Diego Trolley', ''}, --TODO: use test module instead.

{'San Diego Trolley', ''}, --TODO: use test module instead.

-- Icon for a line with an icon. Use .

{'system=testcases/Test module|line=line with title', '16px'},

{'testcases/Test module|line with title', '16px'},

-- Icon for a type without icon, belonging to a line with an icon. Use .

{'system=testcases/Test module|line=line with type|type=type with title', 'File:Taoyuan Metro Line Airport.svg'},

{'testcases/Test module|line with type|type with title', 'File:Taoyuan Metro Line Airport.svg'},

-- Icon for a type with an icon, belonging to a line with an icon. Use .

{'system=testcases/Test module|line=line with type|type=icon type', '16px'},

{'testcases/Test module|line with type|icon type', '16px'},

-- Icon for a type with an icon, belonging to a line without an icon. Use .

{'system=testcases/Test module|line=line without icon with type|type=type with icon', '16px'},

{'testcases/Test module|line without icon with type|type with icon', '16px'},

-- Icon for a type without an icon, belonging to a line without an icon. Use .

{'system=testcases/Test module|line=line without icon with type|type=type without icon', 'File:HK MTR logo (PD).svg'},

{'testcases/Test module|line without icon with type|type without icon', 'File:HK MTR logo (PD).svg'},

-- _default icon for lines. --TODO: add expected.

{'Antwerp tram|1', 'File:DeLijn icon 1antw.svg'}, --TODO: use test module instead.

-- _default icon for lines using alias. --TODO: add expected.

{'Antwerp tram|line 1', 'File:DeLijn icon 1antw.svg'}, --TODO: use test module instead.

-- Override _default icon for lines with icon specified. --TODO: add expected.

{'São Paulo Metropolitan Trains|13-AE', 'File:Cptm 13.svg'}, --TODO: use test module instead.

-- Sole line default. --TODO: add expected.

{'Taiwan High Speed Rail', 'File:Taiwan High Speed Rail Logo(Log Only).svg'}, --TODO: use test module instead.

-- Override icon for line when "icon format" is set. --TODO: add expected.

{'Brampton Transit|Brampton Transit', ''}, --TODO: use test module instead.

})

end

--[[

-- Need to create tests for:

--- ["system icon format"]

--- line_type['icon format']

--- data['type icon format']

--- data['line icon format']

-- inline

--- route without link

--- route with link

--- croute without link

--- croute with link

--- xroute without link

--- xroute with link

--- legend

]]--

function p:test_02_icon_format()

self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {

-- Icon for a line with "system icon format" = "route". --TODO: add expected.

{'system=Brussels Metro|line=1', '1',}, --TODO: use test module instead.

{'Brussels Metro|1', '1',}, --TODO: use test module instead.

-- Icon for a line with "system icon format" = "croute". --TODO: add expected.

{'system=Vorarlberg S-Bahn|line=1', 'S1'}, --TODO: use test module instead.

{'Vorarlberg S-Bahn|1', 'S1'}, --TODO: use test module instead.

-- Icon for a line with "line icon format" = "link". --TODO: add expected.

{'system=MTR|line=Island', '    '}, --TODO: use test module instead.

{'MTR|Island', '    '}, --TODO: use test module instead.

-- Icon for a line with "line icon format" = "link" using alias. --TODO: add expected.

{'system=MTR|line=isl', '    '}, --TODO: use test module instead.

{'MTR|isl', '    '}, --TODO: use test module instead.

-- Icon for a line with "line icon format" = "route". --TODO: add expected.

{'system=Shenzhen Metro|line=1', '1'}, --TODO: use test module instead.

{'Shenzhen Metro|1', '1'}, --TODO: use test module instead.

-- Icon for a line with "line icon format" = "croute". --TODO: add expected.

{'system=MTR Light Rail|line=505', '505'}, --TODO: use test module instead.

{'MTR Light Rail|505', '505'}, --TODO: use test module instead.

})

end

-- Tests for icon format in lines.

function p:test_03_icon_format_lines()

self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {

-- Icon for a line with "icon format" = "link", a linked title, and no short name. --TODO: add expected.

{'system=testcases/Test module|line=link line', '    '},

{'testcases/Test module|link line', '    '},

-- Icon for a line with "icon format" = "route", a linked title, and no short name. Use "route" style with </a>.</p> <p>{'system=testcases/Test module|line=route line', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">501 Züm Queen</span></a></span>'},</p> <p>{'testcases/Test module|route line', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">501 Züm Queen</span></a></span>'},</p> <p>-- Icon for a line with "icon format" = "croute", a linked title, and no short name. Use "croute" style with <a href='?title=%3Ctitle%3E'><title></a>.</p> <p>{'system=testcases/Test module|line=croute line', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">501 Züm Queen</span></a></span>'},</p> <p>{'testcases/Test module|croute line', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">501 Züm Queen</span></a></span>'},</p> <p>-- Icon for a line with "icon format" = "xroute", a linked title, and no short name. Use "xroute" style with <a href='?title=%3Ctitle%3E'><title></a>.</p> <p>{'system=testcases/Test module|line=xroute line', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">501 Züm Queen</span></a></span>'},</p> <p>{'testcases/Test module|xroute line', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">501 Züm Queen</span></a></span>'},</p> <p>-- Icon for a line with "icon format" = "legend", a linked title, and no short name. Use line "legend" style with <a href='?title=%3Ctitle%3E'><title></a>.</p> <p>{'system=testcases/Test module|line=legend line', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>{'testcases/Test module|legend line', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>-- Icon for a line with "icon format" = "link", a linked title, and a short name. --TODO: add expected.</p> <p>{'system=testcases/Test module|line=link line with linked title and short name', '<a href='?title=501_Z%C3%BCm_Queen'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|link line with linked title and short name', '<a href='?title=501_Z%C3%BCm_Queen'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a line with "icon format" = "route", a linked title, and a short name. Use "route" style with <a href='?title=%3Ctitle%3E'><short name></a>.</p> <p>{'system=testcases/Test module|line=route line with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route line linked short name</span></a></span>'},</p> <p>{'testcases/Test module|route line with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route line linked short name</span></a></span>'},</p> <p>-- Icon for a line with "icon format" = "croute", a linked title, and a short name. Use "croute" style with <a href='?title=%3Ctitle%3E'><short name></a>.</p> <p>{'system=testcases/Test module|line=croute line with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute line linked short name</span></a></span>'},</p> <p>{'testcases/Test module|croute line with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute line linked short name</span></a></span>'},</p> <p>-- Icon for a line with "icon format" = "xroute", a linked title, and a short name. Use "xroute" style with <a href='?title=%3Ctitle%3E'><short name></a>.</p> <p>{'system=testcases/Test module|line=xroute line with linked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute line linked short name</span></a></span>'},</p> <p>{'testcases/Test module|xroute line with linked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=501_Z%C3%BCm_Queen'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute line linked short name</span></a></span>'},</p> <p>-- Icon for a line with "icon format" = "legend", a linked title, and a short name. --TODO: add expected.</p> <p>{'system=testcases/Test module|line=legend line with linked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>{'testcases/Test module|legend line with linked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>-- Icon for a line with "icon format" = "link", an unlinked title, and a short name. --TODO: add expected.</p> <p>{'system=testcases/Test module|line=link line with unlinked title and short name', '<span style="background-color:#ff0000;border:1px solid #000">    </span>'},</p> <p>{'testcases/Test module|link line with unlinked title and short name', '<span style="background-color:#ff0000;border:1px solid #000">    </span>'},</p> <p>-- Icon for a line with "icon format" = "route", an unlinked title, and a short name. Use "route" style with <short name>.</p> <p>{'system=testcases/Test module|line=route line with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em;color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route line unlinked short name</span>'},</p> <p>{'testcases/Test module|route line with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em;color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route line unlinked short name</span>'},</p> <p>-- Icon for a line with "icon format" = "croute", an unlinked title, and a short name. Use "croute" style with <short name>.</p> <p>{'system=testcases/Test module|line=croute line with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em;color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute line unlinked short name</span>'},</p> <p>{'testcases/Test module|croute line with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em;color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute line unlinked short name</span>'},</p> <p>-- Icon for a line with "icon format" = "xroute", an unlinked title, and a short name. Use "xroute" style with <short name>.</p> <p>{'system=testcases/Test module|line=xroute line with unlinked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em;color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute line unlinked short name</span>'},</p> <p>{'testcases/Test module|xroute line with unlinked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em;color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute line unlinked short name</span>'},</p> <p>-- Icon for a line with "icon format" = "legend", an unlinked title, and a short name. --TODO: add expected.</p> <p>{'system=testcases/Test module|line=legend line with unlinked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> 501 Züm Queen</div>'},</p> <p>{'testcases/Test module|legend line with unlinked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> 501 Züm Queen</div>'},</p> <p>})</p> <p>end</p> <p>-- Tests for icon format in types.</p> <p>function p:test_04_icon_format_types()</p> <p>self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {</p> <p>-- Icon for a type with "icon format" = "link" and a line with an icon and a linked title.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=link type', '<a href='?title=linked_line_title'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|line with linked title and type|link type', '<a href='?title=linked_line_title'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a type with "icon format" = "route".</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=route type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|route type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "croute".</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=croute type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|croute type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "xroute".</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=xroute type', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|xroute type', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "legend".</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=legend type', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=linked_line_title'>linked line title</a> – legend title</div>'},</p> <p>{'testcases/Test module|line with linked title and type|legend type', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=linked_line_title'>linked line title</a> – legend title</div>'},</p> <p>-- Icon for a type with "icon format" = "link", a linked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=link type with linked title and short name', '<a href='?title=linked_line_title'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|line with linked title and type|link type with linked title and short name', '<a href='?title=linked_line_title'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a type with "icon format" = "route", a linked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=route type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|route type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "croute", a linked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=croute type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|croute type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "xroute", a linked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=xroute type with linked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|xroute type with linked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "legend", a linked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=legend type with linked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=linked_line_title'>linked line title</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>{'testcases/Test module|line with linked title and type|legend type with linked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=linked_line_title'>linked line title</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>-- Icon for a type with "icon format" = "link", an unlinked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=link type with unlinked title and short name', '<a href='?title=linked_line_title'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|line with linked title and type|link type with unlinked title and short name', '<a href='?title=linked_line_title'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a type with "icon format" = "route", an unlinked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=route type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|route type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "croute", an unlinked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=croute type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|croute type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "xroute", an unlinked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=xroute type with unlinked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>{'testcases/Test module|line with linked title and type|xroute type with unlinked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=linked_line_title'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "legend", an unlinked title, and a short name.</p> <p>{'system=testcases/Test module|line=line with linked title and type|type=legend type with unlinked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=linked_line_title'>linked line title</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>{'testcases/Test module|line with linked title and type|legend type with unlinked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=linked_line_title'>linked line title</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>})</p> <p>end</p> <p>function p:test_05_errors_maybe()</p> <p>self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {</p> <p>--[[</p> <p>Tests for a type of a line without a title.</p> <p>]]--</p> <p>--TODO: update type line names</p> <p>-- Icon for a type with "icon format" = "link".</p> <p>{'system=testcases/Test module|line=line without title with type|type=link type', '<a href='?title=Taoyuan_Airport_MRT'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|line without title with type|link type', '<a href='?title=Taoyuan_Airport_MRT'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a type with "icon format" = "route".</p> <p>{'system=testcases/Test module|line=line without title with type|type=route type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|route type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "croute".</p> <p>{'system=testcases/Test module|line=line without title with type|type=croute type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|croute type', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "xroute".</p> <p>{'system=testcases/Test module|line=line without title with type|type=xroute type', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|xroute type', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "legend".</p> <p>{'system=testcases/Test module|line=line without title with type|type=legend type', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – legend title</div>'},</p> <p>{'testcases/Test module|line without title with type|legend type', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – legend title</div>'},</p> <p>-- Icon for a type with "icon format" = "link" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=link type with linked title and short name', '<a href='?title=Taoyuan_Airport_MRT'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|line without title with type|link type with linked title and short name', '<a href='?title=Taoyuan_Airport_MRT'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a type with "icon format" = "route" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=route type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|route type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "croute" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=croute type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|croute type with linked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "xroute" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=xroute type with linked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|xroute type with linked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "legend" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=legend type with linked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>{'testcases/Test module|line without title with type|legend type with linked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>-- Icon for a type with "icon format" = "link" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=link type with unlinked title and short name', '<a href='?title=Taoyuan_Airport_MRT'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>{'testcases/Test module|line without title with type|link type with unlinked title and short name', '<a href='?title=Taoyuan_Airport_MRT'><span style="background-color:#ff0000;border:1px solid #000">    </span></a>'},</p> <p>-- Icon for a type with "icon format" = "route" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=route type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|route type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">route type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "croute" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=croute type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|croute type with unlinked title and short name', '<span style="background-color:#ff0000;border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#FFFFFF;font-weight:bold;font-size:inherit;white-space:nowrap">croute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "xroute" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=xroute type with unlinked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>{'testcases/Test module|line without title with type|xroute type with unlinked title and short name', '<span style="border:.075em solid #ff0000;border-radius:.5em;padding:0 .3em"><a href='?title=Taoyuan_Airport_MRT'><span style="color:#ff0000;font-weight:bold;font-size:inherit;white-space:nowrap">xroute type</span></a></span>'},</p> <p>-- Icon for a type with "icon format" = "legend" and a short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=legend type with unlinked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>{'testcases/Test module|line without title with type|legend type with unlinked title and short name', '<div class="legend" style="page-break-inside:avoid;break-inside:avoid-column"><span class="legend-color" style="display:inline-block;width:1.5em;height:1.5em;margin:1px 0;border:1px solid black;background-color:#ff0000"> </span> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – <a href='?title=501_Z%C3%BCm_Queen'>501 Züm Queen</a></div>'},</p> <p>})</p> <p>end</p> <p>function p:test_06_icon_with_name()</p> <p>self:preprocess_equals_sandbox_many('{{#invoke:Adjacent stations', 'icon', {</p> <p>-- Icon for a system with an icon and a title. Use <system icon> and <title>.</p> <p>{'system=testcases/Test module|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>{'testcases/Test module|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>-- Icon for a system without an icon and a title. Use system title.</p> <p>{'system=San Diego Trolley|name=y', '<a href='?title=San_Diego_Trolley'>San Diego Trolley</a>'}, --TODO: use test module instead.</p> <p>{'San Diego Trolley|name=y', '<a href='?title=San_Diego_Trolley'>San Diego Trolley</a>'}, --TODO: use test module instead.</p> <p>-- Icon for a line with an icon format and a title. --TODO expected</p> <p>{'system=MTR|line=Island|name=y', '<a href='?title=Island_line_%28MTR%29'><span style="background-color:#007dc5;border:1px solid #000">    </span></a> <a href='?title=Island_line_%28MTR%29'>Island line</a>'}, --TODO: use test module instead.</p> <p>{'MTR|Island|name=y', '<a href='?title=Island_line_%28MTR%29'><span style="background-color:#007dc5;border:1px solid #000">    </span></a> <a href='?title=Island_line_%28MTR%29'>Island line</a>'}, --TODO: use test module instead.</p> <p>-- Icon for a line with an icon format and a title using an alias. --TODO expected</p> <p>{'system=MTR|line=isl|name=y', '<a href='?title=Island_line_%28MTR%29'><span style="background-color:#007dc5;border:1px solid #000">    </span></a> <a href='?title=Island_line_%28MTR%29'>Island line</a>'}, --TODO: use test module instead.</p> <p>{'MTR|isl|name=y', '<a href='?title=Island_line_%28MTR%29'><span style="background-color:#007dc5;border:1px solid #000">    </span></a> <a href='?title=Island_line_%28MTR%29'>Island line</a>'}, --TODO: use test module instead.</p> <p>--[[</p> <p>Tests for lines with title variations.</p> <p>]]--</p> <p>-- Icon and name for a line with an icon and a title. Use <icon> and <title>.</p> <p>{'system=testcases/Test module|line=line with title|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>Green Line</a>'},</p> <p>{'testcases/Test module|line with title|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>Green Line</a>'},</p> <p>-- Icon and name for a line with a linked title and a short name. Use <icon> <<a href='?title=title'>short name</a>>.</p> <p>{'system=testcases/Test module|line=line with linked title and shortname|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked short name</a>'},</p> <p>{'testcases/Test module|line with linked title and shortname|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked short name</a>'},</p> <p>-- Icon and name for a line with an unlinked title and a short name. Use <icon> <short name>.</p> <p>{'system=testcases/Test module|line=line with unlinked title and shortname|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> unlinked short name'},</p> <p>{'testcases/Test module|line with unlinked title and shortname|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> unlinked short name'},</p> <p>-- Icon and name for line without title and with short name. Use <short name>.</p> <p>{'system=testcases/Test module|line=line without title and with shortname|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> short name'},</p> <p>{'testcases/Test module|line without title and with shortname|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> short name'},</p> <p>-- Icon and name for line without title. Use <system title>.</p> <p>{'system=testcases/Test module|line=line without title|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>{'testcases/Test module|line without title|name=y', '<a href='?title=File%3ALogo_Green_Line_%28San_Diego_Trolley%29.svg'>16px</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>--[[</p> <p>Tests for lines without icons and title variations.</p> <p>]]--</p> <p>-- Icon and name for line without icon and with title. Use line title.</p> <p>{'system=testcases/Test module|line=line without icon and with title|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>Green Line</a>'},</p> <p>{'testcases/Test module|line without icon and with title|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>Green Line</a>'},</p> <p>-- Icon and name for line without icon and with linked title and short name. Use <a href='?title=line_title'>line short name</a>.</p> <p>{'system=testcases/Test module|line=line without icon and with linked title and shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked short name</a>'},</p> <p>{'testcases/Test module|line without icon and with linked title and shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked short name</a>'},</p> <p>-- Icon and name for line without icon and with unlinked title and short name. Use line short name.</p> <p>{'system=testcases/Test module|line=line without icon and with unlinked title and shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> unlinked short name'},</p> <p>{'testcases/Test module|line without icon and with unlinked title and shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> unlinked short name'},</p> <p>-- Icon and name for line without icon and title and with short name. Use line short name.</p> <p>{'system=testcases/Test module|line=line without icon and title and with shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> short name'},</p> <p>{'testcases/Test module|line without icon and title and with shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> short name'},</p> <p>-- Icon and name for line without icon, title and short name. Use system title.</p> <p>{'system=testcases/Test module|line=line without icon title and shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>{'testcases/Test module|line without icon title and shortname|name=y', '<a href='?title=File%3AHK_MTR_logo_%28PD%29.svg'>File:HK MTR logo (PD).svg</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>--[[</p> <p>Tests for line with title and types with title variations.</p> <p>]]--</p> <p>-- Icon and name for line with title and icon, and type with title. Use line title – type title.</p> <p>{'system=testcases/Test module|line=line with type|type=type with title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – type with title'},</p> <p>{'testcases/Test module|line with type|type with title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – type with title'},</p> <p>-- Icon and name for line with title and icon, and type without title. Use line title.</p> <p>{'system=testcases/Test module|line=line with type|type=type without title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a>'},</p> <p>{'testcases/Test module|line with type|type without title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a>'},</p> <p>-- Icon and name for line with title and icon, and type with linked title and short name. Use line title – <a href='?title=type_title'>type short name</a>.</p> <p>{'system=testcases/Test module|line=line with type|type=type with linked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked type short name</a>'},</p> <p>{'testcases/Test module|line with type|type with linked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked type short name</a>'},</p> <p>-- Icon and name for line with title and icon, and type with unlinked title and short name. Use line title – type short name.</p> <p>{'system=testcases/Test module|line=line with type|type=type with unlinked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – unlinked type short name'},</p> <p>{'testcases/Test module|line with type|type with unlinked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – unlinked type short name'},</p> <p>-- Icon and name for line with title and icon, and type with without title and with short name. Use line title – type short name.</p> <p>{'system=testcases/Test module|line=line with type|type=line without title and with shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – type short name'},</p> <p>{'testcases/Test module|line with type|line without title and with shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Taoyuan_Airport_MRT'>Taoyuan Airport MRT</a> – type short name'},</p> <p>--[[</p> <p>Tests for line without title and types with title variations.</p> <p>]]--</p> <p>-- Icon and name for line without title and icon, and type with title. Use type title.</p> <p>{'system=testcases/Test module|line=line without title with type|type=type with title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> type with title'},</p> <p>{'testcases/Test module|line without title with type|type with title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> type with title'},</p> <p>-- Icon and name for line without title and icon, and type without title. Use system title.</p> <p>{'system=testcases/Test module|line=line without title with type|type=type without title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>{'testcases/Test module|line without title with type|type without title|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=VR_Group'>VR Group</a>'},</p> <p>-- Icon and name for line without title and icon, and type with linked title and short name. Use <a href='?title=type_title'>type short name</a>.</p> <p>{'system=testcases/Test module|line=line without title with type|type=type with linked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked type short name</a>'},</p> <p>{'testcases/Test module|line without title with type|type with linked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> <a href='?title=Green_Line_%28San_Diego_Trolley%29'>linked type short name</a>'},</p> <p>-- Icon and name for line without title and icon, and type with unlinked title and short name. Use type short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=type with unlinked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> unlinked type short name'},</p> <p>{'testcases/Test module|line without title with type|type with unlinked title and shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> unlinked type short name'},</p> <p>-- Icon and name for line without title and icon, and type with without title and with short name. Use type short name.</p> <p>{'system=testcases/Test module|line=line without title with type|type=line without title and with shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> type short name'},</p> <p>{'testcases/Test module|line without title with type|line without title and with shortname|name=y', '<a href='?title=File%3ATaoyuan_Metro_Line_Airport.svg'>File:Taoyuan Metro Line Airport.svg</a> type short name'},</p> <p>})</p> <p>end</p> <p>-- Need tests for:</p> <p>--- |size= – image size, expressed as width (15px), height (x15px) or both if necessary (15x15px).</p> <p>--- |link= – image link (full page name)</p> <p>--- |alt= – alt text</p> <p>--- |bold= – setting for some types of text-based icon; default is "yes" for all of those types</p> <p>--- line without title, type without title - using named and unnamed. Named params seems to ignore error.</p> <p>-- defaults</p> <p>-- overriding - if a line has an icon set to "", it overrides any other setting? overrides only the _default?</p> <p>function p:test_07_errors()</p> <p>-- No module.</p> <p>self:preprocess_equals('{{#invoke:Adjacent stations/sandbox|icon|system=Taipei|R}}', '')</p> <p>-- No type for line.</p> <p>self:preprocess_equals('{{#invoke:Adjacent stations/sandbox|icon|system=testcases/Test module|line=line with type|type=222222}}', '<span class="scribunto-error" id="mw-scribunto-error-0">Lua error: Type "22222" for line "line with type" not in <a href='?title=Module%3AAdjacent_stations%2Ftestcases%2FTest_module'>Module:Adjacent stations/testcases/Test module</a>.</span>')</p> <p>end</p> <p>return p</p></div></section></div></main> <footer class="site-footer"> <div class="footer-container"> <div class="footer-links"> <a href="/about.php">About</a> <a href="/help.php">Help</a> <a href="/updates.php">Updates</a> <a href="/contact.php">Contact</a> <a href="/privacy.php">Privacy</a> <a href="/terms.php">Terms</a> <a href="https://github.com/yourusername/friendly-wiki" target="_blank" rel="noopener">GitHub</a> </div> <div class="footer-copy"> © 2025 Friendly Wiki. All rights reserved. </div> </div> </footer> <script> const toggle = document.getElementById('mobileMenuToggle'); const menu = document.getElementById('mobileMenu'); toggle.addEventListener('click', () => { menu.classList.toggle('active'); }); </script> <!-- Collapsible toggle --> <script> document.addEventListener("DOMContentLoaded", function () { const toggles = document.querySelectorAll('.section-toggle'); toggles.forEach(toggle => { toggle.addEventListener('click', function () { const section = toggle.closest('.collapsible'); const body = section.querySelector('.wiki-body'); body.classList.toggle('collapsed'); }); }); }); </script>