Skip to content

Commit 02c2a46

Browse files
switch uses of like(..., qr/.../m) back to ok( ... =~ ) due to incompatibility in 5.8.x
see https://metacpan.org/pod/perl5101delta#Other-incompatible-changes and http://www.cpantesters.org/cpan/report/f15016a0-2de3-11e5-99ef-54c3deb78640
1 parent 9c9c7e4 commit 02c2a46

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Changes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Revision history for HTTP-Message
22

3+
4+
- fix uses of qr/.../m in tests that do not work in 5.8.x
5+
36
6.09 2015-07-19
47

58
- converted all uses of Test.pm to Test::More

t/common-req.t

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,21 +117,21 @@ note "$c[5]\n";
117117
is(@c, 7);
118118
like($c[6], qr/^--\n/); # 5 parts + header & trailer
119119

120-
like($c[2], qr/^Content-Disposition:\s*form-data;\s*name="email"/m);
121-
like($c[2], qr/^gisle\@aas.no$/m);
120+
ok($c[2] =~ /^Content-Disposition:\s*form-data;\s*name="email"/m);
121+
ok($c[2] =~ /^gisle\@aas.no$/m);
122122

123-
like($c[5], qr/^Content-Disposition:\s*form-data;\s*name="file";\s*filename="$file"/m);
124-
like($c[5], qr/^Content-Type:\s*text\/plain$/m);
125-
like($c[5], qr/^foo\nbar\nbaz/m);
123+
ok($c[5] =~ /^Content-Disposition:\s*form-data;\s*name="file";\s*filename="$file"/m);
124+
ok($c[5] =~ /^Content-Type:\s*text\/plain$/m);
125+
ok($c[5] =~ /^foo\nbar\nbaz/m);
126126

127127
$r = POST 'http://www.perl.org/survey.cgi',
128128
[ file => [ undef, "xxy\"", Content_type => "text/html", Content => "<h1>Hello, world!</h1>" ]],
129129
Content_type => 'multipart/form-data';
130130
#note $r->as_string;
131131

132-
like($r->content, qr/^--\S+\015\012Content-Disposition:\s*form-data;\s*name="file";\s*filename="xxy\\"/m);
133-
like($r->content, qr/^Content-Type: text\/html/m);
134-
like($r->content, qr/^<h1>Hello, world/m);
132+
ok($r->content =~ /^--\S+\015\012Content-Disposition:\s*form-data;\s*name="file";\s*filename="xxy\\"/m);
133+
ok($r->content =~ /^Content-Type: text\/html/m);
134+
ok($r->content =~ /^<h1>Hello, world/m);
135135

136136
$r = POST 'http://www.perl.org/survey.cgi',
137137
Content_type => 'multipart/form-data',

t/message-old.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $req->header(
2020
"if-modified-since" => "Thu, 03 Feb 1994 00:00:00 GMT",
2121
"mime-version" => "1.0");
2222

23-
like($req->as_string, qr/^GET/m);
23+
ok($req->as_string =~ /^GET/m);
2424
is($req->header("MIME-Version"), "1.0");
2525
is($req->if_modified_since, ((760233600 + $offset) || 0));
2626

0 commit comments

Comments
 (0)