13 use open qw( :utf8 :std );
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 { @ǝ::ISA = qw/f/ },
57 sub { @ǝ::ISA = qw/ᛞ/; @ʗ::ISA = qw/f/ },
58 sub { @ʗ::ISA = qw//; @Ạ::ISA = qw/ƙ/ },
59 sub { @Ạ::ISA = qw//; @ᶨ::ISA = qw/f ƙ/ },
60 sub { @ᶨ::ISA = qw/f/; @ʰ::ISA = qw/ƙ ᶢ/ },
61 sub { @ʰ::ISA = qw/ᶢ/; @B::ISA = qw/B/ },
62 sub { @B::ISA = qw//; @ƙ::ISA = qw/ƙ ᶨ ィ/ },
63 sub { @ƙ::ISA = qw/ᶨ ィ/; @ᛞ::ISA = qw/Ạ ʰ B ʗ/ },
66 foreach my $loopy (@loopies) {
68 local $SIG{ALRM} = sub { die "ALRMTimeout" };
71 mro::get_linear_isa('ƙ', '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???");