httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rodent of Unusual Size <Ken.C...@Golux.Com>
Subject t/modules/expires.t .. expected?
Date Tue, 16 Oct 2001 21:46:25 GMT
H',m.  In trying to figure out why modules/expires tests
13, 21, and 33 are failing on Apache 1.3.22-dev, and in my
first fumblings with the perl-framework, I poked into
expires.t.

expires_test() fails at the end if $actual != $expected.  So
I don't quite get how the first if-block sets expected
correctly:

    my $expected = '';
    my $exp_type = '';
    if ($exp_conf =~ /^([A|M])(\d+)$/) {
        $exp_type = $1;
        $expected = $2;
    } else {
        print STDERR "\n\ndoom: $exp_conf\n\n";
        return 0;
    }

    my $actual = 0;
    if ($exp_type eq 'M') {
        $actual = $headers{expires} - $headers{modified};
    } elsif ($exp_type eq 'A') {
        $actual = $headers{expires} - $headers{access};
    }

    print "debug: expected: $expected\n";
    print "debug: actual  : $actual\n";
    return ($actual == $expected);

I would think it would need to include

if ($exp_type eq 'A') {
    $expected += $headers{access};
} else {
    $expected += $headers{modified};
}

but that breaks many more tests (although 13, 22, and 33
pass ;-).
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Mime
View raw message