File: group.t

package info (click to toggle)
libevent-perl 1.28-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 776 kB
  • sloc: ansic: 3,035; perl: 1,122; makefile: 8
file content (23 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!./perl -w

use Test; plan test => 3;
use Event;
require Event::group;

my $gp = Event->group(timeout => 5, cb => \&die);

my $undef;
eval { $gp->add(\$undef) };
ok $@, '/not a thing/';

eval { $gp->add(\$gp) };
ok $@, '/not a thing/';

eval { $gp->add($gp) };
ok $@, '/itself/';

for (1..10) {
    $gp->add(Event->timer(after => 5, cb => \&die));
}

# need more tests here! XXX