Add a test for C3 classes
gfx [Thu, 3 Dec 2009 04:35:31 +0000 (13:35 +0900)]
t/001_mouse/064-class-c3.t [new file with mode: 0644]

diff --git a/t/001_mouse/064-class-c3.t b/t/001_mouse/064-class-c3.t
new file mode 100644 (file)
index 0000000..d1f022f
--- /dev/null
@@ -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)]);