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
89 foreach my $loopy (@loopies) {
91 local $SIG{ALRM} = sub { die "ALRMTimeout" };
93 Algorithm::C3::merge('k', sub {
94 return @{ $loopy->{ $_[0] } };
99 if($err =~ /ALRMTimeout/) {
100 ok(0, "Loop terminated by SIGALRM");
102 elsif($err =~ /Infinite loop detected/) {
103 ok(1, "Graceful exception thrown");
106 ok(0, "Unrecognized exception: $err");
110 ok(0, "Infinite loop apparently succeeded???");