Skip to content

Commit f54ad5d

Browse files
committed
Test StructuredTypeCoercion
1 parent f318d66 commit f54ad5d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

t/basic.t

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ test StructuredTypeConstraint => sub {
133133
);
134134
};
135135

136+
test StructuredTypeCoercion => sub {
137+
my $tc = subtype as Dict[];
138+
coerce $tc, from Undef, via { +{} };
139+
140+
ok(StructuredTypeCoercion->check($_)) for $tc->coercion;
141+
ok(!StructuredTypeCoercion->check($_)) for $tc, Str, 42;
142+
};
143+
136144
test 'MooseX::Role::Parameterized' => sub {
137145
plan skip_all => 'MooseX::Role::Parameterized required'
138146
unless eval { require MooseX::Role::Parameterized; 1 };
@@ -170,8 +178,6 @@ EOR
170178
};
171179
};
172180

173-
# StructuredTypeCoercion
174-
175181
# TypeEquals
176182
# TypeOf
177183
# SubtypeOf

0 commit comments

Comments
 (0)