summaryrefslogtreecommitdiff
path: root/systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm
Initial commit
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm')
-rw-r--r--systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm49
1 files changed, 49 insertions, 0 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm b/systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm
new file mode 100644
index 0000000000..19f0f0835c
--- /dev/null
+++ b/systems/texlive/tlnet/tlpkg/tlperl/lib/ok.pm
@@ -0,0 +1,49 @@
+package ok;
+our $VERSION = '1.302133';
+
+use strict;
+use Test::More ();
+
+sub import {
+ shift;
+
+ if (@_) {
+ 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";
+}
+
+
+__END__
+
+=encoding UTF-8
+
+=head1 NAME
+
+ok - Alternative to Test::More::use_ok
+
+=head1 SYNOPSIS
+
+ use ok 'Some::Module';
+
+=head1 DESCRIPTION
+
+With this module, simply change all C<use_ok> in test scripts to C<use ok>,
+and they will be executed at C<BEGIN> time.
+
+Please see L<Test::use::ok> for the full description.
+
+=head1 CC0 1.0 Universal
+
+To the extent possible under law, 唐鳳 has waived all copyright and related
+or neighboring rights to L<Test-use-ok>.
+
+This work is published from Taiwan.
+
+L<http://creativecommons.org/publicdomain/zero/1.0>
+
+=cut