Subject: | Patch for Content-Type tests |
Date: | Sat, 25 Jun 2011 01:46:17 -0700 |
To: | bug-LWP-ConnCache-MaxKeepAliveRequests [...] rt.cpan.org |
From: | David Storrs <david.storrs [...] gmail.com> |
Hi Leon,
Installing LWP-ConnCache-MaxKeepAliveRequests on my MBP OSX 10.5.8
with perl 5.10.1 fails. The test is checking for a specific charset
on the return value (iso-8859-1), but http://search.cpan.org is
returning simply 'text/html' to me. I loosened the test definition as
follows and it passes and appears to work.
The patch is included; I hope it helps.
Dave
root@loki:~/.cpanm/latest-build/LWP-ConnCache-MaxKeepAliveRequests-0.32/t$
diff -u simple.t.orig simple.t
--- simple.t.orig 2011-06-25 01:11:25.000000000 -0700
+++ simple.t 2011-06-25 01:38:33.000000000 -0700
@@ -14,14 +14,14 @@
);
my $response = $ua->get('http://search.cpan.org/');
-is( $response->header('Content-Type'), 'text/html; charset=iso-8859-1' );
+like( $response->header('Content-Type'), qr{text/html}, 'Response
header is as expected' );
is( $response->header('Client-Response-Num'), 1 );
$response = $ua->get('http://search.cpan.org/');
-is( $response->header('Content-Type'), 'text/html; charset=iso-8859-1' );
+like( $response->header('Content-Type'), qr{text/html}, 'Response
header is as expected' );
is( $response->header('Client-Response-Num'), 2 );
$response = $ua->get('http://search.cpan.org/');
-is( $response->header('Content-Type'), 'text/html; charset=iso-8859-1' );
+like( $response->header('Content-Type'), qr{text/html}, 'Response
header is as expected' );
is( $response->header('Client-Response-Num'), 1 );