Author: stas Date: Tue Sep 20 13:49:07 2005 New Revision: 290559 URL: http://svn.apache.org/viewcvs?rev=290559&view=rev Log: do some more testing (and good as an example) on the line_num and filename of the custom directive
Modified: perl/modperl/trunk/t/response/TestDirective/cmdparms.pm Modified: perl/modperl/trunk/t/response/TestDirective/cmdparms.pm URL: http://svn.apache.org/viewcvs/perl/modperl/trunk/t/response/TestDirective/cmdparms.pm?rev=290559&r1=290558&r2=290559&view=diff ============================================================================== --- perl/modperl/trunk/t/response/TestDirective/cmdparms.pm (original) +++ perl/modperl/trunk/t/response/TestDirective/cmdparms.pm Tue Sep 20 13:49:07 2005 @@ -4,6 +4,7 @@ use warnings FATAL => 'all'; use Apache2::CmdParms (); +use Apache2::Directive (); use base qw(Apache2::Module); use Apache::Test; @@ -49,7 +50,11 @@ $srv_cfg->{$args}{check_ctx} = $parms->check_cmd_context(Apache2::Const::NOT_IN_LOCATION); - $srv_cfg->{$args}{limited} = $parms->method_is_limited('GET'); + $srv_cfg->{$args}{limited} = $parms->method_is_limited('GET'); + + my $directive = $parms->directive; + $srv_cfg->{$args}{line_num} = $directive->line_num; + $srv_cfg->{$args}{filename} = $directive->filename; } ### response handler ### @@ -58,7 +63,7 @@ my $override; my $srv_cfg = $self->get_config($r->server); - plan $r, tests => 9 + ( 7 * keys(%$srv_cfg) ); + plan $r, tests => 11 + ( 7 * keys(%$srv_cfg) ); foreach my $cfg (values %$srv_cfg) { ok t_cmp(ref($cfg->{cmd}), 'Apache2::Command', 'cmd'); @@ -84,6 +89,9 @@ ok t_cmp($vhost->{path}, undef, 'path'); ok t_cmp($vhost->{check_ctx}, undef, 'check_cmd_ctx'); ok $vhost->{limited}; + + ok t_cmp $vhost->{filename}, qr|httpd.conf$|, "config filename"; + ok t_cmp $vhost->{line_num}, qr|^\d+$|, "config filename line_num"; } # Location