Fix a bug where $/ ended up being undef globally.
This commit is contained in:
parent
e47ec1fd16
commit
b4ef882e4c
2 changed files with 5 additions and 3 deletions
|
|
@ -619,7 +619,7 @@ sub getFileContentsAsScalar {
|
||||||
my $filename = shift;
|
my $filename = shift;
|
||||||
my $content;
|
my $content;
|
||||||
open (my $FILE,"<",$self->getPath($filename));
|
open (my $FILE,"<",$self->getPath($filename));
|
||||||
local undef $/;
|
local $/;
|
||||||
$content = <$FILE>;
|
$content = <$FILE>;
|
||||||
close($FILE);
|
close($FILE);
|
||||||
return $content;
|
return $content;
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
my ($extensionTests, $fileIconTests) = setupDataDrivenTests($session);
|
my ($extensionTests, $fileIconTests) = setupDataDrivenTests($session);
|
||||||
|
|
||||||
my $numTests = 81; # increment this value for each test you create
|
my $numTests = 82; # increment this value for each test you create
|
||||||
plan tests => $numTests + scalar @{ $extensionTests } + scalar @{ $fileIconTests };
|
plan tests => $numTests + scalar @{ $extensionTests } + scalar @{ $fileIconTests };
|
||||||
|
|
||||||
my $uploadDir = $session->config->get('uploadsPath');
|
my $uploadDir = $session->config->get('uploadsPath');
|
||||||
|
|
@ -171,7 +171,7 @@ open my $fcon, "< ".$filePath or
|
||||||
die "Unable to open $filePath for reading: $!\n";
|
die "Unable to open $filePath for reading: $!\n";
|
||||||
my $fileContents;
|
my $fileContents;
|
||||||
{
|
{
|
||||||
local undef $/;
|
local $/;
|
||||||
$fileContents = <$fcon>;
|
$fileContents = <$fcon>;
|
||||||
}
|
}
|
||||||
close $fcon;
|
close $fcon;
|
||||||
|
|
@ -180,6 +180,8 @@ is ($fileContents, $content, 'file contents match');
|
||||||
|
|
||||||
is ($storage1->getFileContentsAsScalar($filename), $content, 'getFileContentsAsScalar matches');
|
is ($storage1->getFileContentsAsScalar($filename), $content, 'getFileContentsAsScalar matches');
|
||||||
|
|
||||||
|
isnt($/, undef, 'getFileContentsAsScalar did not change $/');
|
||||||
|
|
||||||
foreach my $extTest (@{ $extensionTests }) {
|
foreach my $extTest (@{ $extensionTests }) {
|
||||||
is( $storage1->getFileExtension($extTest->{filename}), $extTest->{extension}, $extTest->{comment} );
|
is( $storage1->getFileExtension($extTest->{filename}), $extTest->{extension}, $extTest->{comment} );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue