diff options
author | Karl Berry <karl@freefriends.org> | 2016-04-05 22:27:26 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2016-04-05 22:27:26 +0000 |
commit | b56b320b5e2515160073fa1b469514002688fe11 (patch) | |
tree | 965a7100c5e45fca8ec803d22b8b6ce14fca4633 /Master/tlpkg/tlperl/lib/ok.pm | |
parent | d26c206452d2e285c3bbf949f34011e4a55fd8f9 (diff) |
tlperl 5.22.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@40252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/ok.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/ok.pm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Master/tlpkg/tlperl/lib/ok.pm b/Master/tlpkg/tlperl/lib/ok.pm new file mode 100644 index 00000000000..02726ac9641 --- /dev/null +++ b/Master/tlpkg/tlperl/lib/ok.pm @@ -0,0 +1,47 @@ +package ok; +$ok::VERSION = '0.16'; + +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__ + +=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 |