This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix link to crosby paper on hash complexity attack
[perl5.git] / cpan / Test-Simple / t / capture.t
CommitLineData
afad11a2
RS
1use strict;
2
3use Test::Tester;
4
5my $Test = Test::Builder->new;
6$Test->plan(tests => 3);
7
8my $cap;
9
10$cap = Test::Tester->capture;
11
12{
13 no warnings 'redefine';
14 sub Test::Tester::find_run_tests { return 0};
15}
16
17local $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}