Jump to content

Module:Coordinates/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dragons flight (talk | contribs) at 05:13, 5 March 2013. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:Coordinates]]. Click talk page to run tests.
local p = require('Module:UnitTests')
 
function p:test_coord()
    self:preprocess_equals_preprocess_many('{{#invoke:Coordinates|coord|', '}}', 
            '{{coord|', '}}', {
        {'57|18|22|N|4|27|32|W', '57|18|22|N|4|27|32|W'},
        {'44.112|N|87.913|W', '44.112|N|87.913|W'},
        {'44.112|-87.913', '44.112|-87.913'},
        {'44.117|-87.913|dim:30_region:US-WI_type:landmark|name=Klann Road', '44.117|-87.913|dim:30_region:US-WI_type:landmark|name=Klann Road'},
        {'10.2|-20.3|display=inline', '10.2|-20.3|display=inline'},
        {'10.2|-20.3', '10.2|-20.3'},
        {'44.4|-111.1|type:city_region:US', '44.4|-111.1|type:city_region:US'},
        {'51.01234|-1.56789|type:landmark_region:GB', '51.01234|-1.56789|type:landmark_region:GB'},
        {'-35.5|150.1|type:landmark_region:AU', '-35.5|150.1|type:landmark_region:AU'},
        {'12|34|12|N|45|33|45|W', '12|34|12|N|45|33|45|W'},
        {'43.651234|-79.383333', '5'},
        {'43.65|-79.38', '5'},
        {'43.6500|-79.3800', '5'},
        {'43.651234|N|79.383333|W', '5'},
        {'43|29|N|79|23|W', '5'},
        {'43|29|4|N|79|23|0|W', '5'},
        {'43|29|4.5|N|79|23|0.5|W', '5'},
        {'55.752222|N|37.615556|E', '5'},
        {'55.752222|N|37.615556|E|format=dms', '5'},
        {'39.098095|-94.587307|format=dms', '5'},
        {'55.752222|N|37.615556|E|format=dec|name=Moscow', '5'},
        {'33|55|S|18|25|E', '5'},
        {'35|00|N|105|00|E', '5'},
        {'22|54|30|S|43|14|37|W', '5'},
        {'22|S|43|W', '5'},
        {'52|28|59|N|1|53|37|W|display=inline,title|region:GB_type:city', '5'},
        {'46|43|N|7|58|E|type:mountain', '5'},
        {'51.500611|N|0.124611|W|scale:1000', '5'},
        {'51.500611|N|0.124611|W|scale:10000', '5'},
        {'51.500611|N|0.124611|W|scale:100000', '5'},
        {'51.500611|N|0.124611|W|scale:1000000', '5'},
        {'0|N|90|W|dim:10000000', '5'},
        {'40.5|-82.5|dim:400000', '5'},
        {'51.033|13.73|dim:20000', '5'},
        {'40.6892|-74.0445|dim:100', '5'},
        {'45.516194|-122.673226|dim:0.6', '5'},
        {'46.9524|N|7.4396|E|region:CH', '5'},
        {'52.5164|N|13.3775|E|region:DE-BE', '5'},
        {'0|40|26.69|N|23|28|22.69|E|globe:moon', '5'},
        {'48.269|N|225.990|W|globe:mars', '5'},
        {'7.5|S|303|E|globe:venus', '5'},
        {'8|N|190.5|W|globe:mercury', '5'},
        {'52.5164|N|13.3775|E|region:DE-BE', '5'},
    })
end

return p