]> git.vpit.fr Git - perl/modules/Test-Leaner.git/blobdiff - t/04-fallback-import-arg.t
Croak when importing symbols from Test::More that aren't in Test::Leaner
[perl/modules/Test-Leaner.git] / t / 04-fallback-import-arg.t
index ee2bbd5ee9e14d8a83b621cfd63dc37131238fe3..2d74d136737ff9bd2faaeead9e92b553895512d9 100644 (file)
@@ -50,7 +50,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 +72,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 {