Skip to content

Commit

Permalink
Item10516: perltidy
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x01@11169 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed Mar 21, 2011
1 parent ea21e66 commit b1e9823
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions UnitTestContrib/test/unit/UploadScriptTests.pm
Expand Up @@ -149,7 +149,9 @@ sub test_redirectto_param {
redirectto => 'http://blah.com/',
changeproperties => 0,
);
$this->assert_matches( qr#Location: http://(.*?)$this->{test_web}/$this->{test_topic}#ms, $result );
$this->assert_matches(
qr#Location: http://(.*?)$this->{test_web}/$this->{test_topic}#ms,
$result );
}

sub test_oversized_upload {
Expand Down Expand Up @@ -209,7 +211,8 @@ sub test_illegal_upload {
my $this = shift;
local $/;
my $data = 'asdfasdf';
my ($goodfilename, $badfilename) = Foswiki::Sandbox::sanitizeAttachmentName( 'F$%^&&**()_ .php' );
my ( $goodfilename, $badfilename ) =
Foswiki::Sandbox::sanitizeAttachmentName('F$%^&&**()_ .php');
try {
$this->do_upload(
$badfilename,
Expand All @@ -223,7 +226,7 @@ sub test_illegal_upload {
}
catch Foswiki::OopsException with {
my $e = shift;
$this->assert_str_equals( $goodfilename, $e->{params}[1] );
$this->assert_str_equals( $goodfilename, $e->{params}[1] );
$this->assert_str_equals( "upload_name_changed", $e->{def} );
};
}
Expand All @@ -232,7 +235,8 @@ sub test_illegal_propschange {
my $this = shift;
local $/;
my $data = 'asdfasdf';
my ($goodfilename, $badfilename) = Foswiki::Sandbox::sanitizeAttachmentName( 'F$%^&&**()_ .php' );
my ( $goodfilename, $badfilename ) =
Foswiki::Sandbox::sanitizeAttachmentName('F$%^&&**()_ .php');
try {
$this->do_upload(
$badfilename,
Expand All @@ -246,7 +250,7 @@ sub test_illegal_propschange {
}
catch Foswiki::OopsException with {
my $e = shift;
$this->assert_str_equals( $goodfilename, $e->{params}[1] );
$this->assert_str_equals( $goodfilename, $e->{params}[1] );
$this->assert_str_equals( "upload_name_changed", $e->{def} );
};
try {
Expand All @@ -262,7 +266,7 @@ sub test_illegal_propschange {
}
catch Foswiki::OopsException with {
my $e = shift;
$this->assert_str_equals( $goodfilename, $e->{params}[1] );
$this->assert_str_equals( $goodfilename, $e->{params}[1] );
$this->assert_str_equals( "upload_name_changed", $e->{def} );
};
}
Expand Down Expand Up @@ -308,7 +312,7 @@ qr/\[\[%ATTACHURL%\/Flappadoodle\.txt\]\[Flappadoodle\.txt\]\]: Educate the hedg
sub test_imagelink {
my $this = shift;
local $/;
my $imageFile = $Foswiki::cfg{PubDir}.'/System/DocumentGraphics/bomb.png';
my $imageFile = $Foswiki::cfg{PubDir} . '/System/DocumentGraphics/bomb.png';
open FILE, '<', $imageFile;
my $data = do { local $/; <FILE> };
my $filename = 'bomb.png';
Expand All @@ -323,7 +327,7 @@ sub test_imagelink {
);
$this->assert_matches( qr/^Status: 302/, $result );
$filename = Assert::TAINT($filename);
$result = $this->do_upload(
$result = $this->do_upload(
$filename,
$data,
hidefile => 1,
Expand Down

0 comments on commit b1e9823

Please sign in to comment.