[perl-Glib-IO] Add another Glib::IO::Cancellable test



commit 16f3671d1266390e553cba33668c7bce90da2beb
Author: Torsten Schönfeld <kaffeetisch gmx de>
Date:   Mon May 3 22:49:46 2010 +0200

    Add another Glib::IO::Cancellable test

 t/cancellable.t |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/t/cancellable.t b/t/cancellable.t
index e3fd506..396e353 100644
--- a/t/cancellable.t
+++ b/t/cancellable.t
@@ -5,9 +5,12 @@ use Test::More tests => 2;
 use Glib::IO;
 
 my $cancellable = Glib::IO::Cancellable->new ();
-$cancellable->connect (sub {
+$cancellable->connect (\&callback, [ 23, 'bla' ]);
+sub callback {
   my ($data) = @_;
-  is ($data->[0], 23);
-  is ($data->[1], 'bla');
-}, [ 23, 'bla' ]);
+  is_deeply ($data, [ 23, 'bla' ]);
+}
 $cancellable->cancel ();
+
+eval { $cancellable->set_error_if_cancelled (); };
+ok (defined $@);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]