7 use Algorithm::C3; # we already did use_ok 10 times by now..
9 plan skip_all => "Your system has no SIGALRM" if !exists $SIG{ALRM};
14 These are like the 010_complex_merge_classless test,
15 but an infinite loop has been made in the heirarchy,
16 to test that we can fail cleanly instead of going
128 foreach my $loopy (@loopies) {
130 local $SIG{ALRM} = sub { die "ALRMTimeout" };
132 Algorithm::C3::merge('k', sub {
133 return @{ $loopy->{ $_[0] } };
138 if($err =~ /ALRMTimeout/) {
139 ok(0, "Loop terminated by SIGALRM");
141 elsif($err =~ /Infinite loop detected/) {
142 ok(1, "Graceful exception thrown");
145 ok(0, "Unrecognized exception: $err");
149 ok(0, "Infinite loop apparently succeeded???");