This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Test::Simple from version 1.302056 to 1.302059
[perl5.git] / cpan / Test-Simple / lib / ok.pm
index b94db1a..4a42d75 100644 (file)
@@ -1,30 +1,26 @@
 package ok;
-use strict;
-use warnings;
-
-use Test::More 1.301001 ();
-use Carp qw/croak/;
+$ok::VERSION = '1.302059';
 
-our $VERSION = '1.301001_034';
-$VERSION = eval $VERSION;    ## no critic (BuiltinFunctions::ProhibitStringyEval)
+use strict;
+use Test::More ();
 
 sub import {
     shift;
 
     if (@_) {
-        croak "'use ok' called with an empty argument, did you try to use a package name from an uninitialized variable?"
-            unless defined $_[0];
-
         goto &Test::More::pass if $_[0] eq 'ok';
         goto &Test::More::use_ok;
     }
+
+    # No argument list - croak as if we are prototyped like use_ok()
+    my (undef, $file, $line) = caller();
+    ($file =~ /^\(eval/) or die "Not enough arguments for 'use ok' at $file line $line\n";
 }
 
-1;
 
 __END__
 
-=encoding utf8
+=encoding UTF-8
 
 =head1 NAME
 
@@ -41,14 +37,6 @@ and they will be executed at C<BEGIN> time.
 
 Please see L<Test::use::ok> for the full description.
 
-=head1 MAINTAINERS
-
-=over 4
-
-=item Chad Granum E<lt>exodist@cpan.orgE<gt>
-
-=back
-
 =head1 CC0 1.0 Universal
 
 To the extent possible under law, 唐鳳 has waived all copyright and related