Apache2-ASP

 view release on metacpan or  search on metacpan

t/900-old-tests/04.01-syntax-errors.t  view on Meta::CPAN

#!/usr/bin/env perl -w

use strict;
use warnings 'all';
use base 'Apache2::ASP::Test::Base';
#use Test::More 'no_plan';
use Test::More;
plan skip_all => 'Test irrelevant for now';


my $s = __PACKAGE__->SUPER::new();

# Syntax error in the requested page:
{
  local $SIG{__WARN__} = sub { 0 };
  my $res = eval { $s->ua->get("/coverage/syntax-error.asp") };

  ok( ! $res->is_success, "unsuccessful" );
  ok( $res->status_line =~ m/500\s+/, "status code of 500: '" . $res->status_line . "'" );

  ok(
    $s->ua->context->server->GetLastError,
    "Error says something about a syntax error"
  );
}


# Syntax error in an included file:
{
  local $SIG{__WARN__} = sub { 0 };
  my $res = eval { $s->ua->get("/coverage/includes-syntax-error.asp") };
  
  ok( (! $res) || ( ! $res->is_success ), 'request failed' );
  if( $res )
  {
    ok( ! $res->is_success, "unsuccessful" );
    ok( $res->status_line =~ m/500\s+/, "status code of 500: '" . $res->status_line . "'" );
  }# end if()
  ok(
    $s->ua->context->server->GetLastError,
    "Error says something about a syntax error"
  );
}


# Syntax error in a master page:
{
  local $SIG{__WARN__} = sub { 0 };
  my $res = eval { $s->ua->get("/coverage/syntax-error-master.asp") };

  ok( (! $res) || ( ! $res->is_success ), 'request failed' );
  if( $res )
  {
    ok( ! $res->is_success, "unsuccessful" );
    ok( $res->status_line =~ m/500\s+/, "status code of 500: '" . $res->status_line . "'" );
  }# end if()
  ok(
    $s->ua->context->server->GetLastError,
    "Error says something about a syntax error"
  );
}


# Syntax error in a master page, but we request the child page:
{
  local $SIG{__WARN__} = sub { 0 };
  my $res = eval { $s->ua->get("/coverage/page-using-syntax-error-masterpage.asp") };

  ok( (! $res) || ( ! $res->is_success ), 'request failed' );
  if( $res )
  {



( run in 0.717 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )