]> err.no Git - libchamplain/commitdiff
Test reslecting already selected markers
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Sat, 11 Jul 2009 09:09:13 +0000 (11:09 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 21:28:44 +0000 (17:28 -0400)
bindings/perl/Champlain/t/ChamplainSelectionLayer.t

index 1409acf3bf1c1c7ba0c715eaeeb95a29333abf6a..7972bd0bb9dbe8944bd7f0dd3cd448d51ce5278f 100644 (file)
@@ -162,25 +162,24 @@ sub test_markers_multiple {
        );
 
 
-       # Select again one of the selected markers, this unselects it
+       # Select again one of the selected markers, should still be selected
        $layer->select($marker);
-       ok(!$layer->marker_is_selected($marker), "[multiple] select() deselects an already selected marker");
+       ok($layer->marker_is_selected($marker), "[multiple] select() an already selected marker");
        $count = $layer->count_selected_markers;
-       is($count, 2, "[multiple] count_selected_markers() with a deselected marker");
+       is($count, 3, "[multiple] count_selected_markers() with an already selected marker");
        is_deeply(
                [ $layer->get_selected_markers ],
-               [$layer_markers[1], $layer_markers[3]],
+               [$layer_markers[1], $layer_markers[3], $marker],
                "[multiple] get_selected_markers()"
        );
 
-
        # Remove a marker
        $layer->unselect($layer_markers[1]);
        $count = $layer->count_selected_markers;
-       is($count, 1, "[multiple] count_selected_markers() after unselect()");
+       is($count, 2, "[multiple] count_selected_markers() after unselect()");
        is_deeply(
                [ $layer->get_selected_markers ],
-               [$layer_markers[3]],
+               [$layer_markers[3], $marker],
                "[multiple] get_selected_markers()"
        );