Skip to content

Commit

Permalink
Merge pull request #264 from chuckadams/issue/263
Browse files Browse the repository at this point in the history
relaxed test for "Module doesnt exist" in t/require.t
  • Loading branch information
schwern committed Jun 11, 2013
2 parents a0baba1 + c11277a commit faf4925
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions t/require.t
Expand Up @@ -23,13 +23,14 @@ note "Module doesn't exist"; {
local $!;
local @INC = qw(no thing);
ok !eval { "I::Sure::Dont::Exist"->require; };
is $@,
sprintf(qq[Can't locate %s in \@INC (\@INC contains: %s) at %s line %d.\n],
"I/Sure/Dont/Exist.pm", "no thing", __FILE__, __LINE__-3);
my $pat = q[^Can't locate I/Sure/Dont/Exist\.pm in \@INC];
$pat .= q[(?: \(you may need to install the I::Sure::Dont::Exist module\))?];
$pat .= sprintf(' \(@INC contains: no thing\) at %s line %d\.$',
__FILE__, __LINE__-4);
like $@, qr/$pat/;
ok !$!, "errno didn't leak out";
}


note "Invalid module name"; {
ok !eval { "/tmp::LOL::PWNED"->require };
like $@, qr{^'/tmp::LOL::PWNED' is not a valid module name };
Expand Down

0 comments on commit faf4925

Please sign in to comment.