diff --git a/Makefile.PL b/Makefile.PL index 60c8ac3..47fa647 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -18,12 +18,6 @@ WriteMakefile( 'Capture::Tiny' => 0, 'Carp' => 0, 'if' => 0, - - # for Scalar::Type tests, these will eventually get ported to Test2 - 'Test::Exception' => 0, - 'Test::More' => 0.96, - - # for Test2::Tools::Type, earlier probably works too 'Test2::API' => 1.302198, 'Test2::V0' => 0.000159, }, diff --git a/t/bool.t b/t/bool.t index 8868bb0..9183f4e 100644 --- a/t/bool.t +++ b/t/bool.t @@ -1,8 +1,4 @@ -use strict; -use warnings; - -use Test::More; -use Test::Exception; +use Test2::V0; use Config; @@ -25,11 +21,10 @@ if(Scalar::Type::bool_supported) { ok(!is_bool(''), "and it says no for plain old '' (otherwise indistinguishable from (1 == 0))"); } else { # the :all above only included is_bool if bool_supported so we need to use the full name here - throws_ok( - sub { Scalar::Type::is_bool(1 == 1) }, + like + dies { Scalar::Type::is_bool(1 == 1) }, qr/::is_bool not supported on your perl/, - "is_bool carks it on Ye Olde Perle $]" - ); + "is_bool carks it on Ye Olde Perle $]"; is( type(1 == 1), 'INTEGER', @@ -42,11 +37,10 @@ if(Scalar::Type::bool_supported) { ); # finally, test that we can't explicitly import is_bool on Ye Olde Perle - throws_ok( - sub { Scalar::Type->import('is_bool') }, + like + dies { Scalar::Type->import('is_bool') }, qr/is_bool/, - "can't import is_bool on Ye Olde Perle $]" - ); + "can't import is_bool on Ye Olde Perle $]"; } done_testing; diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 03f2fb1..487727a 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -1,7 +1,5 @@ -use strict; -use warnings; +use Test2::V0; -use Test::More; eval "use Test::Pod::Coverage 1.08"; plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" if $@; foreach my $module (grep { diff --git a/t/pod.t b/t/pod.t index 1dc5734..77bae10 100644 --- a/t/pod.t +++ b/t/pod.t @@ -1,7 +1,5 @@ -use strict; -use warnings; +use Test2::V0; -use Test::More; eval "use Test::Pod 1.18"; plan skip_all => "Test::Pod 1.18 required for testing POD" if $@; all_pod_files_ok(grep { $_ !~ m{Number/Phone/UK/Data.pm$} } all_pod_files()); diff --git a/t/sizeof.t b/t/sizeof.t index c54648e..c82047a 100644 --- a/t/sizeof.t +++ b/t/sizeof.t @@ -1,8 +1,4 @@ -use strict; -use warnings; - -use Test::More; -use Test::Exception; +use Test2::V0; use Config; @@ -17,16 +13,14 @@ subtest "sizeof(number)" => sub { }; subtest "sizeof(whatever)" => sub { - throws_ok( - sub { sizeof() }, + like + dies { sizeof() }, qr{::sizeof requires an argument at t/sizeof.t line}, - "sizeof() requires an argument" - ); - throws_ok( - sub { sizeof("banana") }, + "sizeof() requires an argument"; + like + dies { sizeof("banana") }, qr{::sizeof: 'banana' isn't numeric: SCALAR}, - "sizeof()'s arg must be plausibly numeric" - ); + "sizeof()'s arg must be plausibly numeric"; }; done_testing; diff --git a/t/types.t b/t/types.t index ff081a3..71ec5ad 100644 --- a/t/types.t +++ b/t/types.t @@ -1,9 +1,6 @@ -use strict; -use warnings; -no warnings 'void'; +use Test2::V0; -use Test::More; -use Test::Exception; +no warnings 'void'; use Scalar::Type qw(is_* type); use B; @@ -190,20 +187,17 @@ subtest "type returns the documented values for non-reference types" => sub { is(type(undef), 'UNDEF', 'undef is of type UNDEF'); }; -throws_ok( - sub { type() }, +like + dies { type() }, qr{::type requires an argument at t/types.t line}, - "type() requires an argument" -); -throws_ok( - sub { is_number() }, + "type() requires an argument"; +like + dies { is_number() }, qr{::is_number requires an argument at t/types.t line}, - "is_number() requires an argument" -); -throws_ok( - sub { is_integer() }, + "is_number() requires an argument"; +like + dies { is_integer() }, qr{::is_integer requires an argument at t/types.t line}, - "is_integer() requires an argument" -); + "is_integer() requires an argument"; done_testing;