Apache-ASP

 view release on metacpan or  search on metacpan

t/global.asa  view on Meta::CPAN


# script tag not needed, just in for IIS Compat test
<script runat=server>

use lib '.';	
use T;	
use strict;
use vars qw($Application $Session $t $Deep);
use Carp qw(confess);

$SIG{__DIE__} = \&confess;

sub Application_OnStart {
    $Application->{Start} = 1;
}

sub Session_OnStart {
    $Session->{Count} = 10;
}

sub Script_OnStart {
    $t = T->new();
}

sub Script_OnEnd {
    $t && $t->done;
}

sub Script_OnFlush {
    my $data = $Response->{BinaryRef};
    for ( split(/\n/, $$data) ) {
	next if /^\s*$/;
	unless(/^((not )?ok)|\d+\.\.\d+/) {
	    $t->eok(0, "Garbage in output: $_");
	}
    }
}

sub my::print {
    my($args, $html) = @_;
    print $html;
}

sub my::tag {
    $t->eok($Deep, 'Deep tag not evaluated');
}

sub my::deeptag {
    $t->ok;
    $Deep++;
}

sub my::tag_check_value {
    my $args = shift;
    if($args->{value}) {
	$t->ok;
    } else {
	$t->not_ok;
    }
}

sub my::tag_check_value_ref {
    my($args) = shift;
    if(ref $args->{value}) {
	$t->ok;



( run in 1.778 second using v1.01-cache-2.11-cpan-39bf76dae61 )