12 use open qw( :utf8 :std );
16 plan(skip_all => "Your system has no SIGALRM") if !exists $SIG{ALRM};
21 These are like the 010_complex_merge_classless test,
22 but an infinite loop has been made in the heirarchy,
23 to test that we can fail cleanly instead of going
28 # initial setup, everything sane
54 # A series of 8 aberations that would cause infinite loops,
55 # each one undoing the work of the previous
57 sub { @ǝ::ISA = qw/f/ },
58 sub { @ǝ::ISA = qw/ᛞ/; @ʗ::ISA = qw/f/ },
59 sub { @ʗ::ISA = qw//; @Ạ::ISA = qw/ƙ/ },
60 sub { @Ạ::ISA = qw//; @ᶨ::ISA = qw/f ƙ/ },
61 sub { @ᶨ::ISA = qw/f/; @ʰ::ISA = qw/ƙ ᶢ/ },
62 sub { @ʰ::ISA = qw/ᶢ/; @B::ISA = qw/B/ },
63 sub { @B::ISA = qw//; @ƙ::ISA = qw/ƙ ᶨ ィ/ },
64 sub { @ƙ::ISA = qw/ᶨ ィ/; @ᛞ::ISA = qw/Ạ ʰ B ʗ/ },
67 foreach my $loopy (@loopies) {
69 local $SIG{ALRM} = sub { die "ALRMTimeout" };
72 mro::get_linear_isa('ƙ', 'dfs');
76 if($err =~ /ALRMTimeout/) {
77 ok(0, "Loop terminated by SIGALRM");
79 elsif($err =~ /Recursive inheritance detected/) {
80 ok(1, "Graceful exception thrown");
83 ok(0, "Unrecognized exception: $err");
87 ok(0, "Infinite loop apparently succeeded???");