內容

名稱

TAP::Parser::Result::Plan - 計畫結果標記。

版本

版本 3.44

描述

這是 TAP::Parser::Result 的子類別。如果遇到計畫列,將傳回此類別的標記。

1..1
ok 1 - woo hooo!

1..1 是計畫。一定要有計畫。

覆寫方法

主要列於此處以阻止 pod 涵蓋範圍測試的悲慘叫聲。它們讓我在夜裡無法入眠。

實例方法

plan

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

這只是 as_string 的同義詞。

tests_planned

my $planned = $result->tests_planned;

傳回已規劃的測試數量。例如,1..17 的規劃將導致此方法傳回「17」。

directive

my $directive = $plan->directive; 

如果 SKIP 指令包含在規劃中,此方法將傳回它。

1..0 # SKIP: why bother?

has_skip

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

傳回布林值,指出此測試是否有 SKIP 指令。

explanation

my $explanation = $plan->explanation;

如果 SKIP 指令包含在規劃中,此方法將傳回說明(如果有)。

todo_list

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