aboutsummaryrefslogtreecommitdiff
path: root/test/timeout2.t
diff options
context:
space:
mode:
authorPSYC <psyc@lectern.tobij.de>2009-04-06 15:36:55 +0200
committerPSYC <psyc@lectern.tobij.de>2009-04-06 15:36:55 +0200
commit2cbbcd317182fe962719027e860703c24901d891 (patch)
tree0d3a4722c1584a67d505a653604016830c6a3368 /test/timeout2.t
downloadperlpsyc-2cbbcd317182fe962719027e860703c24901d891.tar.gz
perlpsyc-2cbbcd317182fe962719027e860703c24901d891.zip
perlPSYC-0.26.zip
Diffstat (limited to 'test/timeout2.t')
-rw-r--r--test/timeout2.t36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/timeout2.t b/test/timeout2.t
new file mode 100644
index 0000000..fd2026f
--- /dev/null
+++ b/test/timeout2.t
@@ -0,0 +1,36 @@
1# vim:syntax=perl
2#!/usr/bin/perl -w
3
4use strict;
5BEGIN {
6 unless (eval "require Event") {
7 print "You don't have Event.pm installed. No Problem.\nSkipping this test.\n";
8 exit;
9 }
10 require Test::Simple;
11 import Test::Simple qw(tests 1);
12 require Time::HiRes;
13 import Time::HiRes qw(gettimeofday tv_interval);
14 require Net::PSYC;
15 import Net::PSYC qw(Event=Event);
16}
17
18my $c = 0;
19my ($s1, $m1, $f);
20
21sub t {
22 $c++;
23
24 if ($c == 3) {
25 ok(1, 'Timeout events with Event.');
26 stop_loop();
27 }
28
29 1;
30}
31
32add(1, 'i', \&t);
33print "!\tIf nothing happens for more than 5 seconds,\n!\tterminate the test and report the failure!\n";
34start_loop();
35
36__END__