Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relaxed test for "Module doesnt exist" in t/require.t #264

Merged
merged 2 commits into from Jun 11, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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