From: gfx Date: Thu, 3 Dec 2009 04:35:31 +0000 (+0900) Subject: Add a test for C3 classes X-Git-Tag: 0.40_09~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35c4ef08aae9626d0984bff45377f9b8afec54ba;p=gitmo%2FMouse.git Add a test for C3 classes --- diff --git a/t/001_mouse/064-class-c3.t b/t/001_mouse/064-class-c3.t new file mode 100644 index 0000000..d1f022f --- /dev/null +++ b/t/001_mouse/064-class-c3.t @@ -0,0 +1,34 @@ +#!perl +use strict; +use warnings; + +BEGIN{ + eval{ require MRO::Compat }; + eval{ require mro }; +} + +use Test::More defined(&mro::get_linear_isa) + ? (tests => 1) + : (skip_all => 'This test requires mro'); + +{ + package Base; + use Mouse; + + package Left; + use Mouse; + extends 'Base'; + + package Right; + use Mouse; + extends 'Base'; + + package Diamond; + use Mouse; + use mro 'c3'; + + extends qw(Left Right); + +} + +is_deeply([Diamond->meta->linearized_isa], [qw(Diamond Left Right Base Mouse::Object)]);