-
Notifications
You must be signed in to change notification settings - Fork 8
/
check_sugar.t
55 lines (47 loc) · 1.5 KB
/
check_sugar.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
use strict;
use warnings;
{
package TestClass;
use Moose;
}
{
package TestClass::NotCleaned;
use Moose;
no Moose;
}
use Test::Builder::Tester; # tests => 1;
use Test::More;
use Test::Moose::More;
# not ok 1 - TestRole can has
# not ok 2 - TestRole can around
# not ok 3 - TestRole can augment
# not ok 4 - TestRole can inner
# not ok 5 - TestRole can before
# not ok 6 - TestRole can after
# not ok 7 - TestRole can blessed
# not ok 8 - TestRole can confess
# check for sugar in a class that still has it
my $i;
do { $i++; test_out "ok $i - TestClass can $_" }
for Test::Moose::More::known_sugar();
check_sugar_ok 'TestClass';
test_test 'check_sugar_ok works correctly';
# check for sugar in a class that has none
$i = 0;
do { $i++; test_out "not ok $i - TestClass::NotCleaned can $_"; test_fail(2) }
for Test::Moose::More::known_sugar();
check_sugar_ok 'TestClass::NotCleaned';
test_test 'check_sugar_ok works correctly on classes without sugar';
# check for no sugar in a class that still has it
$i = 0;
do { $i++; test_out "not ok $i - TestClass cannot $_"; test_fail(2) }
for Test::Moose::More::known_sugar();
check_sugar_removed_ok 'TestClass';
test_test 'check_sugar_removed_ok works correctly with sugar';
# check for no sugar in a class that has none
$i = 0;
do { $i++; test_out "ok $i - TestClass::NotCleaned cannot $_" }
for Test::Moose::More::known_sugar();
check_sugar_removed_ok 'TestClass::NotCleaned';
test_test 'check_sugar_removed_ok works correctly w/o sugar';
done_testing;