You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2003/01/23 02:32:22 UTC
cvs commit: modperl-2.0/t/response/TestError syntax.pm runtime.pm
stas 2003/01/22 17:32:22
Added: t/error syntax.t runtime.t
t/response/TestError syntax.pm runtime.pm
Log:
add runtime and syntax error testing
Revision Changes Path
1.1 modperl-2.0/t/error/syntax.t
Index: syntax.t
===================================================================
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest;
plan tests => 1;
my $location = "/TestError::syntax";
my $res = GET($location);
#t_debug($res->content);
ok t_cmp(
500,
$res->code,
"500 error on syntax error",
);
1.1 modperl-2.0/t/error/runtime.t
Index: runtime.t
===================================================================
use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest;
plan tests => 1;
my $location = "/TestError::runtime";
my $res = GET($location);
#t_debug($res->content);
ok t_cmp(
500,
$res->code,
"500 error on runtime error",
);
1.1 modperl-2.0/t/response/TestError/syntax.pm
Index: syntax.pm
===================================================================
package TestError::syntax;
use strict;
use warnings FATAL => 'all';
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile => qw(OK);
sub handler {
my $r = shift;
$r->content_type('text/plain');
# the following syntax error is here on purpose!
lkj;\;
$r->print('ok');
return Apache::OK;
}
1;
__END__
1.1 modperl-2.0/t/response/TestError/runtime.pm
Index: runtime.pm
===================================================================
package TestError::runtime;
use strict;
use warnings FATAL => 'all';
use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile => qw(OK);
sub handler {
my $r = shift;
$r->content_type('text/plain');
warn "a call to a non-existing function\n";
no_such_func();
$r->print('ok');
return Apache::OK;
}
1;
__END__