author q{Robert "phaylon" Sedlacek <rs@474.at>};
all_from q{lib/MooseX/Types.pm};
-build_requires q{Test::More}, '0.80';
+build_requires q{Test::More}, '0.88';
build_requires q{FindBin}, 0;
build_requires q{Test::Moose}, 0;
build_requires q{Test::Fatal}, 0;
+build_requires q{Test::Requires}, 0;
requires q{Moose}, '1.06';
requires q{Sub::Install}, '0.924';
my @types = MooseX::Types::Moose->type_names;
-plan tests => @types * 3;
-
for my $t (@types) {
ok my $code = __PACKAGE__->can($t), "$t() was exported";
if ($code) {
ok __PACKAGE__->can("is_$t"), "is_$t() was exported";
}
+done_testing;
[ 'IntArrayRef', 12, [12], {}, [17, 23], {} ],
);
-plan tests => (@tests * 8) + 5;
-
# new array ref so we can safely shift from it
for my $data (map { [@$_] } @tests) {
my $type = shift @$data;
eval { require TestNamespaceSep };
ok $@, q(trying to declare a type with '::' in it croaks);
like $@, qr/Foo::Bar/, q(error message contains type name);
+
+done_testing;
[ 'Str', 'Str', 12, "12", [], "foo", [777] ],
);
-plan tests => (@tests * 9);
-
# new array ref so we can safely shift from it
for my $data (map { [@$_] } @tests) {
my $type = shift @$data;
}
}
-
+done_testing;
use warnings;
use strict;
-use Test::More tests => 62;
+use Test::More;
use Test::Fatal;
use FindBin;
use lib "$FindBin::Bin/lib";
}, qr/Attribute \(WierdIntergersArrayRef2_attr\) does not pass the type constraint/
=> 'Constraints properly fail';
-
-
-
+done_testing();
use FindBin;
use lib "$FindBin::Bin/lib";
- eval "use Sub::Exporter";
- plan $@
- ? ( skip_all => "Tests require Sub::Exporter" )
- : ( tests => 3 );
+ use Test::Requires { 'Sub::Exporter' => '0' };
}
use SubExporterCompatibility qw(MyStr something);
ok MyStr->check('aaa'), "Correctly passed";
ok !MyStr->check([1]), "Correctly fails";
ok something(), "Found the something method";
+
+done_testing;
package MooseX::Types::Test::Recursion::TestRunner;
BEGIN {
- use Test::More tests=>5;
+ use Test::More;
## Grab the newly created test type constraint
MooseX::Types::Test::Recursion->import(':all');
ok ! RecursiveHashRef->check({key=>{subkey=>"value",subkey2=>{ssubkey=>[1,2,3]}}})
=> 'Properly invalidates bad value deeply';
-}
-
-
-
-
-
+ done_testing;
+}
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More;
use FindBin;
use lib "$FindBin::Bin/lib";
], 'all calls to has_available_type_export returned correct results');
+done_testing();
use strict;
use warnings;
-use Test::More tests => 5;
+use Test::More;
# remove this when CheckedUtilExports croaks instead of carps
$SIG{__WARN__} = sub { die @_ };
};
eval $role_type;
is $@, '', "declared role_types don't throw error";
+
+done_testing();
use FindBin;
use lib "$FindBin::Bin/lib";
-use Test::More tests => 7;
+use Test::More;
use Test::Fatal;
BEGIN { use_ok 'Combined', qw/Foo2Alias MTFNPY NonEmptyStr/ }
qr/Can't locate DoesNotExist\.pm/,
'cannot combine types from a package which does not exist';
}
+
+done_testing();
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More;
{
package MyRole;
};
ok !$@, 'type export not picked up as a method on role application';
+
+done_testing();
use strict;
use warnings;
-use Test::More tests => 14;
+use Test::More;
my $exception;
{
Test::More::ok !Test3->check({a=>1}), 'fails wrong ref type';
Test::More::ok Test3->check($obj), 'Union allows Object';
}
+
+done_testing();
use strict;
use warnings;
-use Test::More tests => 2;
+use Test::More;
BEGIN {
package TypeLib;
::ok( $subtype->has_coercion, 'coercion applied to subtype' );
}
+done_testing();
use strict;
use warnings;
-use Test::More tests=>5;
+use Test::More;
use MooseX::Types;
use MooseX::Types::Moose qw(Any Item );
ok ( Item->is_subtype_of(Any),
q[Item is subtype of Any]);
+done_testing;