Commit | Line | Data |
c47cf415 |
1 | #!/usr/bin/perl |
2 | # This is automatically generated by author/import-moose-test.pl. |
3 | # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! |
4 | use t::lib::MooseCompat; |
5 | |
6 | use strict; |
7 | use warnings; |
8 | |
9 | use Test::More; |
10 | $TODO = q{Mouse is not yet completed}; |
11 | |
12 | BEGIN { |
13 | use_ok('Mouse::Util', ':all'); |
14 | } |
15 | |
16 | { package SCBR::Role; |
17 | use Mouse::Role; |
18 | } |
19 | |
20 | { package SCBR::A; |
21 | use Mouse; |
22 | } |
23 | is search_class_by_role('SCBR::A', 'SCBR::Role'), undef, '... not found role returns undef'; |
24 | is search_class_by_role('SCBR::A', SCBR::Role->meta), undef, '... not found role returns undef'; |
25 | |
26 | { package SCBR::B; |
27 | use Mouse; |
28 | extends 'SCBR::A'; |
29 | with 'SCBR::Role'; |
30 | } |
31 | is search_class_by_role('SCBR::B', 'SCBR::Role'), 'SCBR::B', '... class itself returned if it does role'; |
32 | is search_class_by_role('SCBR::B', SCBR::Role->meta), 'SCBR::B', '... class itself returned if it does role'; |
33 | |
34 | { package SCBR::C; |
35 | use Mouse; |
36 | extends 'SCBR::B'; |
37 | } |
38 | is search_class_by_role('SCBR::C', 'SCBR::Role'), 'SCBR::B', '... nearest class doing role returned'; |
39 | is search_class_by_role('SCBR::C', SCBR::Role->meta), 'SCBR::B', '... nearest class doing role returned'; |
40 | |
41 | { package SCBR::D; |
42 | use Mouse; |
43 | extends 'SCBR::C'; |
44 | with 'SCBR::Role'; |
45 | } |
46 | is search_class_by_role('SCBR::D', 'SCBR::Role'), 'SCBR::D', '... nearest class being direct class returned'; |
47 | is search_class_by_role('SCBR::D', SCBR::Role->meta), 'SCBR::D', '... nearest class being direct class returned'; |
48 | |
49 | done_testing; |