Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Ordnance Survey coordinates/testcases
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local p = require('Module:UnitTests') local geohack='[https://geohack.toolforge.org/geohack.php?' local pagename='pagename=Module_talk:Ordnance_Survey_coordinates/testcases¶ms=' local GBloc = '53.256537528703_N_1.7991023201338_W' local IEloc = '53.323792633602_N_6.2463579903284_W' local GBNEloc = '60.459656359818_N_1.280627981272_W' local IENEloc = '52.141163081547_N_9.6237020674491_W' local GBos = 'SK135733' local IEos ='O169318' function p:test_main() self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | '..GBos..'}}', geohack..pagename..GBloc..'_region:GB'..' '..GBos..']') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | '..GBos..'_scale:25000}}', geohack..pagename..GBloc..'_scale:25000_region:GB'..' '..GBos..']') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | '..IEos..'}}', geohack..pagename..IEloc..'_region:IE'..' '..IEos..']') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | 439668_1175316 | Crooksetter}}', geohack..pagename..GBNEloc..'_region:GB Crooksetter]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | name=Example title | 439668_1175316 | Crooksetter }}', geohack..pagename..GBNEloc..'_region:GB&title=Example+title Crooksetter]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | 439668_1175316_region:GB-SCT_scale:25000 | Crooksetter}}', geohack..pagename..GBNEloc..'_region:GB-SCT_scale:25000 Crooksetter]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | i88888_99999 | The Linbins}}', geohack..pagename..IENEloc..'_region:IE The Linbins]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | i88888_99999_scale:25000 | The Linbins}}', geohack..pagename..IENEloc..'_scale:25000_region:IE The Linbins]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | i88888_99999_scale:25000 | The Linbins | name=Example title}}', geohack..pagename..IENEloc..'_scale:25000_region:IE&title=Example+title The Linbins]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | SK 135 733}}', geohack..pagename..GBloc..'_region:GB'..' SK 135 733]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | 123 TQ 456 | Bad}}','Bad') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | main | busted | Nowhere}}','Nowhere') end function p:test_main_sandbox() self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | '..GBos..'}}', geohack..pagename..GBloc..'_region:GB'..' '..GBos..']') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | '..GBos..'_scale:25000}}', geohack..pagename..GBloc..'_scale:25000_region:GB'..' '..GBos..']') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | '..IEos..'}}', geohack..pagename..IEloc..'_region:IE'..' '..IEos..']') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | 439668_1175316 | Crooksetter}}', geohack..pagename..GBNEloc..'_region:GB Crooksetter]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | name=Example title | 439668_1175316 | Crooksetter }}', geohack..pagename..GBNEloc..'_region:GB&title=Example+title Crooksetter]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | 439668_1175316_region:GB-SCT_scale:25000 | Crooksetter}}', geohack..pagename..GBNEloc..'_region:GB-SCT_scale:25000 Crooksetter]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | i88888_99999 | The Linbins}}', geohack..pagename..IENEloc..'_region:IE The Linbins]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | i88888_99999_scale:25000 | The Linbins}}', geohack..pagename..IENEloc..'_scale:25000_region:IE The Linbins]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | i88888_99999_scale:25000 | The Linbins | name=Example title}}', geohack..pagename..IENEloc..'_scale:25000_region:IE&title=Example+title The Linbins]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | SK 135 733}}', geohack..pagename..GBloc..'_region:GB'..' SK 135 733]') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | 123 TQ 456 | Bad}}','Bad') self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | main | busted | Nowhere}}','Nowhere') end local before = '<span class="plainlinks nourlexpansion" style="white-space: nowrap">' local after = '</span>' function p:test_oscoord() self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | oscoord | '..GBos..'}}', before..geohack..pagename..GBloc..'_region:GB'..' '..GBos..']'..after) self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | oscoord | '..GBos..'_scale:25000}}', before..geohack..pagename..GBloc..'_scale:25000_region:GB'..' '..GBos..']'..after) self:preprocess_equals('{{#invoke:Ordnance Survey coordinates | oscoord | '..IEos..'}}', before..geohack..pagename..IEloc..'_region:IE'..' '..IEos..']'..after) end function p:test_oscoord_sandbox() self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | oscoord | '..GBos..'}}', before..geohack..pagename..GBloc..'_region:GB'..' '..GBos..']'..after) self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | oscoord | '..GBos..'_scale:25000}}', before..geohack..pagename..GBloc..'_scale:25000_region:GB'..' '..GBos..']'..after) self:preprocess_equals('{{#invoke:Ordnance Survey coordinates/sandbox | oscoord | '..IEos..'}}', before..geohack..pagename..IEloc..'_region:IE'..' '..IEos..']'..after) end return p
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:Ordnance Survey coordinates/testcases/doc
(
edit
)