TAP::Parser::Result::Plan - Plan result token.


Test-Harness documentation Contained in the Test-Harness distribution.

Index


Code Index:

NAME

Top

TAP::Parser::Result::Plan - Plan result token.

VERSION

Top

Version 3.23

DESCRIPTION

Top

This is a subclass of TAP::Parser::Result. A token of this class will be returned if a plan line is encountered.

 1..1
 ok 1 - woo hooo!

1..1 is the plan. Gotta have a plan.

OVERRIDDEN METHODS

Top

Mainly listed here to shut up the pitiful screams of the pod coverage tests. They keep me awake at night.

* as_string
* raw

Instance Methods

plan

  if ( $result->is_plan ) {
     print $result->plan;
  }

This is merely a synonym for as_string.

tests_planned

  my $planned = $result->tests_planned;

Returns the number of tests planned. For example, a plan of 1..17 will cause this method to return '17'.

directive

 my $directive = $plan->directive; 

If a SKIP directive is included with the plan, this method will return it.

 1..0 # SKIP: why bother?

has_skip

  if ( $result->has_skip ) { ... }

Returns a boolean value indicating whether or not this test has a SKIP directive.

explanation

 my $explanation = $plan->explanation;

If a SKIP directive was included with the plan, this method will return the explanation, if any.

todo_list

  my $todo = $result->todo_list;
  for ( @$todo ) {
      ...
  }


Test-Harness documentation Contained in the Test-Harness distribution.
package TAP::Parser::Result::Plan;

use strict;

use vars qw($VERSION @ISA);
use TAP::Parser::Result;
@ISA = 'TAP::Parser::Result';

$VERSION = '3.23';

##############################################################################

sub plan { '1..' . shift->{tests_planned} }

##############################################################################

sub tests_planned { shift->{tests_planned} }

##############################################################################

sub directive { shift->{directive} }

##############################################################################

sub explanation { shift->{explanation} }

sub todo_list { shift->{todo_list} }

1;