This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update to the latest Test-Simple cpan dist
[perl5.git] / cpan / Test-Simple / t / Legacy / capture.t
1 use strict;
2
3 use Test::Tester;
4
5 my $Test = Test::Builder->new;
6 $Test->plan(tests => 3);
7
8 my $cap;
9
10 $cap = Test::Tester->capture;
11
12 {
13         no warnings 'redefine';
14         sub Test::Tester::find_run_tests { return 0};
15 }
16
17 local $Test::Builder::Level = 0;
18 {
19         my $cur = $cap->current_test;
20         $Test->is_num($cur, 0, "current test");
21
22         eval {$cap->current_test(2)};
23         $Test->ok($@, "can't set test_num");
24 }
25
26 {
27         $cap->ok(1, "a test");
28
29         my @res = $cap->details;
30
31         $Test->is_num(scalar @res, 1, "res count");
32 }