File: capture.t

package info (click to toggle)
libtest-tester-perl 0.109-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 164 kB
  • ctags: 44
  • sloc: perl: 463; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 488 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use strict;

use Test::Tester;

my $Test = Test::Builder->new;
$Test->plan(tests => 3);

my $cap;

$cap = Test::Tester->capture;

{
	no warnings 'redefine';
	sub Test::Tester::find_run_tests { return 0};
}

local $Test::Builder::Level = 0;
{
	my $cur = $cap->current_test;
	$Test->is_num($cur, 0, "current test");

	eval {$cap->current_test(2)};
	$Test->ok($@, "can't set test_num");
}

{
	$cap->ok(1, "a test");

	my @res = $cap->details;

	$Test->is_num(scalar @res, 1, "res count");
}