Changeset 73

Show
Ignore:
Timestamp:
12/02/09 20:40:54 (4 years ago)
Author:
clinton
Message:

Update and greatly expand the error-handling tests. Found some problems and made tickets. tid10737 tid10892

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/t/conf/extra.conf.in

    r57 r73  
    44   
    55# where Mungo can be found 
    6 PerlSwitches -I@ServerRoot@/../lib 
     6PerlSwitches -I@ServerRoot@/../blib 
     7 
     8# Required for some tests in group 13-errors 
     9PerlSwitches -I@ServerRoot@/htdocs/13-errors/lib 
    710 
    811# preload the module 
  • trunk/t/htdocs/13-errors/catch-exception.asp

    • Property svn:mergeinfo set
    r10 r73  
    22 
    33eval { 
    4   my $a = undef
    5   $a->badmethod()
     4     die "mungo-success\n"
     5     print "mungo-failure"
    66}; 
    7 if($@) { 
    8   %><%= $@ %><% 
    9 
     7  if($@) { 
     8    print $@; 
     9  } else { 
     10    print "no exception seen"; 
     11  } 
    1012 
    1113%> 
  • trunk/t/lib/MungoTestUtils.pm

    r72 r73  
    5555            $info = { like => $info }; 
    5656        } 
     57        next if $info->{hardskip}; 
    5758        $info->{page} = $test_page; 
    5859        $info->{base} = $base; 
    5960        $info->{label} ||= $test_page; 
     61        $info->{status} ||= 200; 
    6062 
    6163        my $todo    = $info->{todo} || 0; 
     
    7577    my $test_count_ref = shift; 
    7678    my $qs      = $info->{query} || ''; 
    77     my $status  = $info->{status} || 200; 
    78     my $pattern = $info->{like}; 
    7979    my $page    = $info->{page}; 
    8080    my $label   = $info->{label}; 
     
    8383 
    8484    my $response = GET $url; 
    85     is($response->code, $status, "$label should have HTTP status $status"); 
    86     $$test_count_ref++; 
     85  TODO: { 
     86        local $TODO = $info->{status} == 500 ? 'awaiting fix on trac17' : $TODO; 
     87        is($response->code, $info->{status}, "$label should have HTTP status $info->{status}"); 
     88        $$test_count_ref++; 
     89    } 
    8790 
    8891    # Header check 
     
    9699    # Content Checks 
    97100    my $content = $response->content(); 
    98     like($content, $pattern, "$label should have correct content"); 
    99     $$test_count_ref++; 
    100  
     101    if ($info->{like}) { 
     102        like($content, $info->{like}, "$label should have correct content"); 
     103        $$test_count_ref++; 
     104    } 
     105    if ($info->{unlike}) { 
     106        unlike($content, $info->{unlike}, "$label should not have incorrect content"); 
     107        $$test_count_ref++; 
     108    } 
    101109    unlike($content, qr{(<\%)|(\%>)}, "$label should not contain mungo start or end tags "); 
    102110    $$test_count_ref++;