httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache
Date Thu, 22 Nov 2001 02:04:35 GMT wrote:

> dougm       01/11/21 12:59:23
>   Added:       perl-framework/Apache-Test/lib/Apache
>   Log:
>   new module for common tests that are run from more than 1 .t file

isn't it "common" only for httpd-test, but not really common for other 
projects using Apache-Test, e.g. mod_perl comes to mind.

The reason I ask is that gozer has suggested to have a similar thing for 
mod_perl stuff. For example he saw that many methods that are based on 
apr_table_t have identical tests, so he suggested to write a common test 
and remove duplication from tests. But than you have already taken 
TestCommon here.

I think these should live outside Apache-Test, somewhere under t/ 
specific to each project. For example t/lib/

here's gozer's request:

Philippe M. Chiasson wrote:

Hey, I am tired of writing test for all sort of things that behave
like hash and set/get things

$r->method() returns a hash
$r->method('key') returns the value
$r->method('key','value') sets the value and returns the value

bla bla bla...

Where should I put something like this :

sub test_hashish {
     my ($hash,$name) = @_;
         ok $hash->$name;

     ok UNIVERSAL::isa($hash->$name,'HASH');

     ok t_cmp("${name}_bar", $hash->$name("${name}_foo","${name}_bar"), 
         ok t_cmp("${name}_bar", $hash->$name("${name}_foo") , 
qq{\$hash->$name(key)});           ok t_cmp("${name}_bar", 
$hash->$name()->{"${name}_foo"}, qq{\$hash->$name()->{key}});


so you can simply do

Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker      mod_perl Guide

View raw message