15 plan(skip_all => "Your system has no SIGALRM") if !exists $SIG{ALRM};
20 These are like the 010_complex_merge_classless test,
21 but an infinite loop has been made in the heirarchy,
22 to test that we can fail cleanly instead of going
27 # initial setup, everything sane
53 # A series of 8 aberations that would cause infinite loops,
54 # each one undoing the work of the previous
56 sub { @E::ISA = qw/F/ },
57 sub { @E::ISA = qw/D/; @C::ISA = qw/F/ },
58 sub { @C::ISA = qw//; @A::ISA = qw/K/ },
59 sub { @A::ISA = qw//; @J::ISA = qw/F K/ },
60 sub { @J::ISA = qw/F/; @H::ISA = qw/K G/ },
61 sub { @H::ISA = qw/G/; @B::ISA = qw/B/ },
62 sub { @B::ISA = qw//; @K::ISA = qw/K J I/ },
63 sub { @K::ISA = qw/J I/; @D::ISA = qw/A H B C/ },
66 foreach my $loopy (@loopies) {
68 local $SIG{ALRM} = sub { die "ALRMTimeout" };
71 mro::get_linear_isa('K', 'dfs');
75 if($err =~ /ALRMTimeout/) {
76 ok(0, "Loop terminated by SIGALRM");
78 elsif($err =~ /Recursive inheritance detected/) {
79 ok(1, "Graceful exception thrown");
82 ok(0, "Unrecognized exception: $err");
86 ok(0, "Infinite loop apparently succeeded???");