[svn:mod_parrot] rev 174 - in mod_parrot/trunk/t: . conf lib
[email protected] 22 Jul 2005 16:08:49 -0000
Newsgroups
perl.cvs.mod_parrot
Message-ID
<[email protected] >
Author: jhorwitz
Date: Fri Jul 22 09:08:48 2005
New Revision: 174
Modified:
mod_parrot/trunk/t/01RequestRec.t
mod_parrot/trunk/t/conf/extra.conf.in
mod_parrot/trunk/t/lib/handlers.imc
Log:
test Apache::RequestRec::status
Modified: mod_parrot/trunk/t/01RequestRec.t
==============================================================================
--- mod_parrot/trunk/t/01RequestRec.t (original)
+++ mod_parrot/trunk/t/01RequestRec.t Fri Jul 22 09:08:48 2005
@@ -7,7 +7,7 @@ use Test::More;
my $content;
-plan tests => 9, (need_lwp);
+plan tests => 10, (need_lwp);
# Apache::RequestRec->content_type
my $res = GET '/parrot-test/RequestRec-content_type';
@@ -39,6 +39,10 @@ $res = GET '/parrot-test/RequestRec-note
chomp($content = $res->content);
is($content, 'bar', 'notes');
+# Apache::RequestRec->status
+$res = GET '/parrot-test/RequestRec-status';
+is($res->code, 201, 'status');
+
# Apache::RequestRec->log_rerror
$res = GET '/parrot-test/RequestRec-log_rerror';
# read whole error_log into memory -- should be small
Modified: mod_parrot/trunk/t/conf/extra.conf.in
==============================================================================
--- mod_parrot/trunk/t/conf/extra.conf.in (original)
+++ mod_parrot/trunk/t/conf/extra.conf.in Fri Jul 22 09:08:48 2005
@@ -49,6 +49,12 @@ ParrotLoad @ServerRoot@/../lib/pugs/Apac
ParrotHandler ModParrot::Test::notes
</Location>
+<Location /parrot-test/RequestRec-status>
+ SetHandler parrot-code
+ ParrotLanguage PIR
+ ParrotHandler ModParrot::Test::status
+</Location>
+
<Location /parrot-test/RequestRec-log_rerror>
SetHandler parrot-code
ParrotLanguage PIR
Modified: mod_parrot/trunk/t/lib/handlers.imc
==============================================================================
--- mod_parrot/trunk/t/lib/handlers.imc (original)
+++ mod_parrot/trunk/t/lib/handlers.imc Fri Jul 22 09:08:48 2005
@@ -261,3 +261,19 @@ authz_done:
.return $I0
.pcc_end_return
.end
+
+.namespace [ 'ModParrot::Test::status' ]
+
+.sub _handler
+ .param pmc r
+ .local pmc ap_const
+
+ r.'status'(201)
+
+ ap_const = find_global 'Apache::Constants', 'ap_constants'
+ $I0 = ap_const['OK']
+
+ .pcc_begin_return
+ .return $I0
+ .pcc_end_return
+.end