From modperl-cvs-return-4643-apmail-perl-modperl-cvs-archive=perl.apache.org@perl.apache.org Fri Jul 23 23:46:13 2004 Return-Path: Delivered-To: apmail-perl-modperl-cvs-archive@www.apache.org Received: (qmail 61048 invoked from network); 23 Jul 2004 23:46:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 23 Jul 2004 23:46:13 -0000 Received: (qmail 82808 invoked by uid 500); 23 Jul 2004 23:46:13 -0000 Delivered-To: apmail-perl-modperl-cvs-archive@perl.apache.org Received: (qmail 82774 invoked by uid 500); 23 Jul 2004 23:46:12 -0000 Mailing-List: contact modperl-cvs-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@perl.apache.org Delivered-To: mailing list modperl-cvs@perl.apache.org Received: (qmail 82761 invoked by uid 500); 23 Jul 2004 23:46:12 -0000 Delivered-To: apmail-modperl-2.0-cvs@apache.org X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Date: 23 Jul 2004 23:46:12 -0000 Message-ID: <20040723234612.61042.qmail@minotaur.apache.org> From: stas@apache.org To: modperl-2.0-cvs@apache.org Subject: cvs commit: modperl-2.0/t/response/TestAPI content_encoding.pm request_rec.pm X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N stas 2004/07/23 16:46:11 Modified: t/response/TestAPI request_rec.pm Added: t/api content_encoding.t t/response/TestAPI content_encoding.pm Log: content_encoding test Revision Changes Path 1.1 modperl-2.0/t/api/content_encoding.t Index: content_encoding.t =================================================================== use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestRequest; use Apache::TestUtil; plan tests => 1, have_min_module_version("Compress::Zlib", "1.09"); my $location = '/TestAPI__content_encoding'; my $expected = 'This is a clear text'; my $res = POST $location, content => $expected; my $received = $res->content; #t_debug($received); if ($res->header('Content-Encoding') =~ /gzip/) { require Compress::Zlib; # gzip already produces data in a network order, so no extra # transformation seem to be necessary $received = Compress::Zlib::memGunzip($received); } ok t_cmp $received, $expected, "Content-Encoding: gzip test"; 1.23 +2 -2 modperl-2.0/t/response/TestAPI/request_rec.pm Index: request_rec.pm =================================================================== RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/request_rec.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -u -r1.22 -r1.23 --- request_rec.pm 23 Jul 2004 21:04:50 -0000 1.22 +++ request_rec.pm 23 Jul 2004 23:46:11 -0000 1.23 @@ -99,8 +99,8 @@ ok $r->handler; - #content_encoding - #content_language + # content_encoding is tested in TestAPI::content_encoding + #content_languages #user 1.1 modperl-2.0/t/response/TestAPI/content_encoding.pm Index: content_encoding.pm =================================================================== package TestAPI::content_encoding; # tests: $r->content_encoding("gzip"); use strict; use warnings;# FATAL => 'all'; use Apache::RequestRec (); use Apache::RequestUtil (); use Apache::Const -compile => qw(OK DECLINED); sub handler { my $r = shift; return Apache::DECLINED unless $r->method_number == Apache::M_POST; my $data = ModPerl::Test::read_post($r); require Compress::Zlib; $r->content_type("text/plain"); $r->content_encoding("gzip"); $r->print(Compress::Zlib::memGzip($data)); Apache::OK; } 1; __END__