X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F02-import-arg.t;h=d2181d23aa093fb0532f600560b43d02718d5f9a;hb=a615878a77fd5a9ae493272815373f1641cb951b;hp=fd6f0f9835a1bae3b1ce6dd709ae454d01927825;hpb=7b03c18e358942c3388e3ba4d93319333a25b9cf;p=perl%2Fmodules%2FTest-Leaner.git diff --git a/t/02-import-arg.t b/t/02-import-arg.t index fd6f0f9..d2181d2 100644 --- a/t/02-import-arg.t +++ b/t/02-import-arg.t @@ -38,6 +38,7 @@ my @default_exports = qw< >; sub check_imports { + local $Test::Builder::Level = ($Test::Builder::Level || 0) + 1; my %imported = map { $_ => 1 } @{ $_[0] || [] }; my @not_imported = @{ $_[1] || [] }; for (@not_imported, grep !$imported{$_}, @default_exports) { @@ -50,7 +51,7 @@ sub check_imports { delete $this_stash->{$_} for @default_exports, keys %imported, @not_imported; } -Test::More::plan(tests => 8 * @default_exports + 7 + 2); +Test::More::plan(tests => 9 * @default_exports + 8 + 3); check_imports(); @@ -72,6 +73,15 @@ check_imports(); check_imports([ ], [ 'nonexistent' ]); } +{ + local $@; + eval { + Test::Leaner->import(import => [ 'use_ok' ]); + }; + Test::More::like($@, qr/^"use_ok" is not exported by the Test::Leaner module/, 'import "use_ok" croaks'); + check_imports([ ], [ 'use_ok' ]); +} + { local $@; eval {