From: Emmanuel Rodriguez Date: Sat, 11 Jul 2009 09:09:13 +0000 (+0200) Subject: Test reslecting already selected markers X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b6eb1bd953feba9fb2c4adf8d8a9185fe24842fa;p=libchamplain Test reslecting already selected markers --- diff --git a/bindings/perl/Champlain/t/ChamplainSelectionLayer.t b/bindings/perl/Champlain/t/ChamplainSelectionLayer.t index 1409acf..7972bd0 100644 --- a/bindings/perl/Champlain/t/ChamplainSelectionLayer.t +++ b/bindings/perl/Champlain/t/ChamplainSelectionLayer.t @@ -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()" );