From: Emmanuel Rodriguez Date: Wed, 6 May 2009 14:06:16 +0000 (+0200) Subject: Test the contents of a Champlain::MapSourceDesc X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55d4ad709d3667578bf16c5b35bf0e1d52cb7a8d;p=libchamplain Test the contents of a Champlain::MapSourceDesc --- diff --git a/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t b/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t index 5f285a7..f163687 100644 --- a/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t +++ b/bindings/perl/Champlain/t/ChamplainMapSourceFactory.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Clutter::TestHelper tests => 22; +use Clutter::TestHelper tests => 31; use Champlain ':coords'; @@ -59,8 +59,27 @@ sub test_map_factory { "Maps for Free Relief" ); + # Get the maps available my @maps = $factory->get_list(); ok(@maps >= 5, "Maps factory has the default maps"); + + # Find the OAM map and check that the it's properly described + my @found = grep { $_->{id} eq Champlain::MapSourceFactory->OAM } @maps; + is(scalar(@found), 1); + if (@found) { + my ($oam_map) = @found; + isa_ok($oam_map, 'Champlain::MapSourceDesc'); + is($oam_map->{id}, Champlain::MapSourceFactory->OAM); + is($oam_map->{name}, 'OpenAerialMap'); + is($oam_map->{license}, "(CC) BY 3.0 OpenAerialMap contributor"); + is($oam_map->{license_uri}, 'http://creativecommons.org/licenses/by/3.0/'); + is($oam_map->{min_zoom_level}, 0); + is($oam_map->{max_zoom_level}, 17); + is($oam_map->{projection}, 'mercator'); + } + else { + fail("Can't test a Champlain::MapSourceDesc without a map description") for 1 .. 8; + } }