BEGIN {
- use strict;
- use warnings;
- use Test::More tests=>88;
+ use strict;
+ use warnings;
+ use Test::More tests=>88;
}
{
PARAMETERIZE: {
ok (my $int = Moose::Util::TypeConstraints::find_or_parse_type_constraint('Int'), 'Got Int');
- ok (my $str = Moose::Util::TypeConstraints::find_or_parse_type_constraint('Str'), 'Got Str');
- ok (my $hashref = Moose::Util::TypeConstraints::find_or_parse_type_constraint('HashRef[Int]'), 'Got HashRef');
+ ok (my $str = Moose::Util::TypeConstraints::find_or_parse_type_constraint('Str'), 'Got Str');
+ ok (my $hashref = Moose::Util::TypeConstraints::find_or_parse_type_constraint('HashRef[Int]'), 'Got HashRef');
## Test Dict->parameterize
ok (my $test_dict = Dict(), 'Created Test Dict');
ok (my $person = $test_dict->parameterize(name=>$str, age=>$int), 'Parameterized It');
ok ($person->check({name=>'John', age=>21}), 'Passed');
ok ($person->check({age=>25, name=>'User'}), 'Passed');
-
+
## Test Tuple->parameterize
ok (my $test_tuple = Tuple(), 'Created Test Tuple');
ok (my $int_and_hashref = $test_tuple->parameterize($int, $hashref), 'Parameterized It');
ok ($int_and_hashref->check([1, {key=>2, key2=>3}]), "Passed");
- ok (!$int_and_hashref->check(['a', {key=>2, key2=>3}]), "Not Passed");
+ ok (!$int_and_hashref->check(['a', {key=>2, key2=>3}]), "Not Passed");
ok (!$int_and_hashref->check([1, {key=>'a', key2=>3}]), "Not Passed");
}