in reply to Re: How do I test a script that doesn't have a .pl extension
in thread How do I test a script that doesn't have a .pl extension
the problem is in _is_module_name# Try to determine if we've been given a module name or file. # Module names must be barewords, files not. $module = qq['$module'] unless _is_module_name($module);
with "foo.pl" it returns 0$module =~ s/\b::\b//g; return $module =~ /^[a-zA-Z]\w*$/ ? 1 : 0;
resolves the problem and works for these tested scenarios# $module =~ s/\b::\b//g; return $module =~ /^[a-zA-Z]\w*$/ ? 1 : 0 if $module =~ s/\b::\b//g;
require_ok("foo"); require_ok('foo'); require_ok("foo.pl"); require_ok('foo.pl'); require_ok("Net::FTP"); require_ok('Net::FTP');
|
|---|