Tweaks for coercions
[gitmo/Mouse.git] / Moose-t-failing / 600_todo_tests / 004_role_insertion_order.t
CommitLineData
c47cf415 1#!/usr/bin/env perl
2# This is automatically generated by author/import-moose-test.pl.
3# DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4use t::lib::MooseCompat;
5use strict;
6use warnings;
7use Test::More;
8$TODO = q{Mouse is not yet completed};
9
10{
11 package Foo::Role;
12 use Mouse::Role;
13 has 'a' => (is => 'ro');
14 has 'b' => (is => 'ro');
15 has 'c' => (is => 'ro');
16}
17
18{
19 package Foo;
20 use Mouse;
21 has 'd' => (is => 'ro');
22 with 'Foo::Role';
23 has 'e' => (is => 'ro');
24}
25
26my %role_insertion_order = (
27 a => 0,
28 b => 1,
29 c => 2,
30);
31
32is_deeply({ map { $_->name => $_->insertion_order } map { Foo::Role->meta->get_attribute($_) } Foo::Role->meta->get_attribute_list }, \%role_insertion_order, "right insertion order within the role");
33
34my %class_insertion_order = (
35 d => 0,
36 a => 1,
37 b => 2,
38 c => 3,
39 e => 4,
40);
41
42{ local $TODO = "insertion order is lost during role application";
43is_deeply({ map { $_->name => $_->insertion_order } Foo->meta->get_all_attributes }, \%class_insertion_order, "right insertion order within the class");
44}
45
46done_testing;