File-Rename
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
t/File-Rename-Options.t view on Meta::CPAN
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 3;
BEGIN { use_ok('File::Rename::Options') };
#########################
# test 2
my $ok = do { local @ARGV = (1); File::Rename::Options::GetOptions() };
ok($ok, 'File::Rename::Options::GetOptions' );
ok(
$File::Rename::Options::VERSION <=
do { require File::Rename; eval $File::Rename::VERSION },
'File::Rename::Option version not ahead of distribution version'
)
t/File-Rename-import.t view on Meta::CPAN
);
# test 3
ok(
!eval q{ CORE::rename( 'bing.txt', 1, 1 ); 1 }, # syntax error
'CORE::rename() is not rename()'
);
# test 4
# use File::Rename includes File::Rename::Options
my $ok = eval q{ local @ARGV = (1); File::Rename::Options::GetOptions() };
ok($ok, 'imported - File::Rename::Options::GetOptions' );
t/File-Rename-require.t view on Meta::CPAN
use Test::More tests => 3;
BEGIN { require_ok('File::Rename') };
#########################
# Insert your test code below, the Test::More module is use()ed here so read
# its man page ( perldoc Test::More ) for help writing this test script.
# require File::Rename should not include File::Rename::Options
my $ok = !eval { local @ARGV = (1); File::Rename::Options::GetOptions(); 1 };
ok($ok, 'not imported File::Rename::Options::GetOptions' );
# eval will fail if rename is CORE::rename
my $eval = eval q{ rename [1], 1, 1; 1; };
# require File::Rename does not import rename
ok(!$eval, 'not imported rename()');
t/testlib.pl view on Meta::CPAN
use strict;
use warnings;
require File::Spec;
require File::Path;
sub main_argv { local @ARGV = @_; main() }
my $tempdir;
sub tempdir {
my $d = 'temp' . $$;
File::Path::rmtree($d) if -d $d;
File::Path::mkpath($d);
return ( $tempdir = $d );
}
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.011 second using v1.00-cache-2.02-grep-82fe00e-cpan-c9a218a2bbc )