Alien-Selenium
view release on metacpan or search on metacpan
inc/Locale/Maketext/Simple.pm view on Meta::CPAN
14151617181920212223242526272829303132333435
$args
{Class} ||=
caller
;
$args
{Style} ||=
'maketext'
;
$args
{Export} ||=
'loc'
;
$args
{Subclass} ||=
'I18N'
;
my
(
$loc
,
$loc_lang
) =
$class
->load_loc(
%args
);
$loc
||=
$class
->default_loc(
%args
);
no
strict
'refs'
;
*{
caller
(0) .
"::$args{Export}"
} =
$loc
if
$args
{Export};
*{
caller
(0) .
"::$args{Export}_lang"
} =
$loc_lang
||
sub
{ 1 };
}
my
%Loc
;
sub
reload_loc {
%Loc
= () }
sub
load_loc {
my
(
$class
,
%args
) =
@_
;
my
$pkg
=
join
(
'::'
,
$args
{Class},
$args
{Subclass});
inc/Module/Load.pm view on Meta::CPAN
42434445464748495051525354555657585960
### because of [perl #19213], see caveats ###
my
$file
= $^O eq
'MSWin32'
?
join
"/"
,
@parts
: File::Spec->catfile(
@parts
);
$file
.=
'.pm'
if
$pm
;
return
$file
;
}
sub
_who { (
caller
(1))[0] }
sub
_is_file {
local
$_
=
shift
;
return
/^\./ ? 1 :
/[^\w:']/ ? 1 :
undef
#' silly bbedit..
}
inc/My/Tests/Below.pm view on Meta::CPAN
89101112131415161718192021222324252627=head1 NAME
B<My::Tests::Below> - invoke a test suite at the end of a module.
=head1 SYNOPSIS
package MyPackage;
<the text of the package goes here>
require My::Tests::Below unless caller();
1;
__END__
use MyPackage;
# And there you go with your test suite
inc/My/Tests/Below.pm view on Meta::CPAN
8990919293949596979899100101102103104105106107108109package
My::Tests::Below;
use
strict;
use
File::Temp ();
our
$VERSION
= 2.0;
## This is done at the top level, not in a sub, as "require
## My::Tests::Below" is what gets the ball rolling:
our
$singleton
= __PACKAGE__->_parse(\
*main::DATA
,
caller
(0));
unless
(
defined
$singleton
) {
die
"My::Tests::Below invoked, but no tests were found below!"
;
}
close
(main::DATA);
$singleton
->run();
## Creates an instance of My::Tests::Below from a source file
## that has tests at the bottom.
sub
_parse {
my
(
$class
,
$fd
,
$package
,
$packfilename
,
$packline
) =
@_
;
inc/My/Tests/Below.pm view on Meta::CPAN
515516517518519520521522523524525526527528529530531532533534535package
Fake::Module;
use
strict;
our
@EXPORT
=
qw(zoinx)
;
sub
zoinx {1}
package
Fake::Module::Sub;
1;
__END__
use Fake::Module;
print "1..2\n";
if (__PACKAGE__ eq "main") {
print "ok 1 # In package 'main' for tests\n";
inc/My/Tests/Below.pm view on Meta::CPAN
550551552553554555556557558559560561562563564565566567568569570like(
$result
,
qr/ok 2/
,
"Test result #2"
);
write_file(
$fakemodule
,
<<'BUGGY_MODULE_WITH_TEST_MORE');
#!perl -Tw
package Fake::Module;
use strict;
1;
require My::Tests::Below unless (caller());
__END__
use Test::More no_plan => 1;
ok(1);
die;
BUGGY_MODULE_WITH_TEST_MORE
$result
= run_perl(
$fakemodule
);
inc/Params/Check.pm view on Meta::CPAN
327328329330331332333334335336337338339340341342343344345346347### check if the key exists in $data ###
sub
_iskey {
my
(
$key
,
$tmpl
) =
@_
;
return
$tmpl
->{
$key
} ? 1 :
undef
;
}
sub
_who_was_it {
my
$level
=
shift
|| 0;
return
(
caller
(2 +
$level
))[3] ||
'ANON'
}
sub
_safe_eq {
my
(
$a
,
$b
) =
@_
;
if
(
defined
(
$a
) &&
defined
(
$b
) ) {
return
$a
eq
$b
;
}
else
{
return
defined
(
$a
) eq
defined
(
$b
);
( run in 0.387 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )