File: 291-async-subtest-done-testing.t

package info (click to toggle)
libtest2-suite-perl 0.000163-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,768 kB
  • sloc: perl: 7,485; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 382 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use Test2::V0;
use Test2::Tools::AsyncSubtest qw/fork_subtest/;

my $st = fork_subtest foo => sub {
    ok(1, "Just a pass");

    like(
        warning { done_testing },
        qr/A plan should not be set inside an async-subtest \(did you call done_testing\(\)\?\)/,
        "We get a warning if we call done_testing inside an asyncsubtest"
    );
};

$st->finish;

done_testing;