]> err.no Git - libchamplain/commitdiff
Libchamplain has now a default selection mode of multiple
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Wed, 16 Sep 2009 18:40:57 +0000 (20:40 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Mon, 21 Sep 2009 16:19:44 +0000 (12:19 -0400)
bindings/perl/Champlain/t/ChamplainSelectionLayer.t

index 8ab8540c1c82002a8fb344d6126aaff0e2e795ad..a2626a4100e088f40f1ebad87f79aaf8b5da4f14 100644 (file)
@@ -26,8 +26,8 @@ sub test_empty_multiple {
        my $layer = Champlain::SelectionLayer->new();
        isa_ok($layer, 'Champlain::Layer');
 
-       is($layer->get_selection_mode, 'multiple');
-       is($layer->get('selection_mode'), 'multiple');
+       is($layer->get_selection_mode, 'single');
+       is($layer->get('selection_mode'), 'single');
 
        is($layer->get_selected, undef, "[empty] get_selected()");
 
@@ -63,11 +63,11 @@ sub test_empty_single {
        my $layer = Champlain::SelectionLayer->new();
        isa_ok($layer, 'Champlain::Layer');
 
-       is($layer->get_selection_mode, 'multiple');
-       is($layer->get('selection_mode'), 'multiple');
-       $layer->set_selection_mode('single');
        is($layer->get_selection_mode, 'single');
        is($layer->get('selection_mode'), 'single');
+       $layer->set_selection_mode('multiple');
+       is($layer->get_selection_mode, 'multiple');
+       is($layer->get('selection_mode'), 'multiple');
 
        is($layer->get_selected, undef, "[empty] get_selected()");
 
@@ -102,6 +102,7 @@ sub test_empty_single {
 sub test_markers_multiple {
        my $layer = Champlain::SelectionLayer->new();
        isa_ok($layer, 'Champlain::Layer');
+       $layer->set_selection_mode('multiple');
 
 
        my @layer_markers = (
@@ -244,6 +245,10 @@ sub test_selection_mode_change {
        my $layer = Champlain::SelectionLayer->new();
        isa_ok($layer, 'Champlain::Layer');
 
+       # In the past the default selection mode was multiple, so we set it back to
+       # single just like in the old times
+       $layer->set_selection_mode('multiple');
+
        my $notify = 0;
        $layer->signal_connect('notify::selection-mode', sub {
                ++$notify;