Subject: | t/incompatible.t fails without Class::C3::XS |
The pure-perl Class::C3 gives a slightly different error message from
Class::C3::XS on inconsistent hierarchies:
t/incompatible....
# Failed test 'inconsistent c3 hierarchy'
# at t/incompatible.t line 33.
# 'Class::C3::calculateMRO('Z') Error: 'Inconsistent
hierarchy found while merging 'Z':
# current merge results [
# Z,
# XY,
# YX
# ]
# merging failed on 'Y'
# '; Falling back to plain NEXT.pm behaviour for this class at
/home/ilmari/.cpan/build/Class-C3-Adopt-NEXT-0.02/blib/lib/Class/C3/Adopt/NEXT.pm
line 30.
# '
# doesn't match '(?i-xsm:inconsistent hierarchy .* merge)'
# Looks like you failed 1 test of 3.
Here's a patch that fixes it (and still works with Class::C3::XS).
--- t/incompatible.t~ 2008-12-02 14:39:19.000000000 +0000
+++ t/incompatible.t 2008-12-05 16:01:48.000000000 +0000
@@ -30,4 +30,4 @@
Z->foo;
is(scalar @warnings, 1, 'got a warning',);
-like($warnings[0], qr/inconsistent hierarchy .* merge/i, 'inconsistent
c3 hierarchy');
+like($warnings[0], qr/inconsistent hierarchy .* merge/si, 'inconsistent
c3 hierarchy');
ilmari@fenchurch:~/.cpan/build/Class-C3-Adopt-NEXT-0.02$ perl -Mblib
t/incompatible.t
1..3
ok 1 - no warnings yet
ok 2 - got a warning
ok 3 - inconsistent c3 hierarchy