]> err.no Git - libchamplain/commitdiff
Test notify::selection-mode
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Sat, 11 Jul 2009 07:14:53 +0000 (09:14 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Tue, 28 Jul 2009 21:27:50 +0000 (17:27 -0400)
bindings/perl/Champlain/t/ChamplainSelectionLayer.t

index d9e966cb47613e7ab8b0c4b162e276537cde393c..7c8ec87466df36fc43f43998ea5c0a26f22e4f8c 100644 (file)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Clutter::TestHelper tests => 48;
+use Clutter::TestHelper tests => 51;
 
 use Champlain;
 use Data::Dumper;
@@ -63,9 +63,15 @@ sub test_empty_single {
        my $layer = Champlain::SelectionLayer->new();
        isa_ok($layer, 'Champlain::Layer');
 
+       my $notify = 0;
+       $layer->signal_connect('notify::selection-mode', sub {
+               ++$notify;
+       });
+
        is($layer->get_selection_mode, 'multiple');
        is($layer->get('selection_mode'), 'multiple');
        $layer->set_selection_mode('single');
+       is($notify, 1, "signal notify::selection-mode emitted");
        is($layer->get_selection_mode, 'single');
        is($layer->get('selection_mode'), 'single');
 
@@ -92,9 +98,11 @@ sub test_empty_single {
 
        # Change the selection mode
        $layer->set_selection_mode('multiple');
+       is($notify, 2, "signal notify::selection-mode emitted");
        is($layer->get_selection_mode, 'multiple');
 
        $layer->set('selection_mode', 'single');
+       is($notify, 3, "signal notify::selection-mode emitted");
        is($layer->get('selection_mode'), 'single');
 
        return 0;