File: defer_plan.t

package info (click to toggle)
libtest-most-perl 0.38-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 192 kB
  • sloc: perl: 543; makefile: 2
file content (60 lines) | stat: -rw-r--r-- 806 bytes parent folder | download | duplicates (4)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/perl

BEGIN { $ENV{DO_NOT_WARN_ON_DEFER_PLAN} = 1 }
use lib 'lib', 't/lib';
use Test::Most qw<defer_plan>;

ok 1;
ok 1;
ok 1;
all_done(3);

__END__

# :(

use Test::Command;

my $prog = q{
	use strict;
	use warnings;

	use lib 'lib', 't/lib';
	use Test::Most qw<defer_plan>;

	ok(1);
	die("premature termination");
	ok(1);
	ok(1);
	all_done();
};
stdout_like(['perl', '-e', $prog], qr/1\.\.2\n\Z/);

$prog = q{
	use strict;
	use warnings;

	use lib 'lib', 't/lib';
	use Test::Most qw<defer_plan>;

	ok(1);
	ok(1);
	ok(1);
	all_done();
};
stdout_like(['perl', '-e', $prog], qr/1\.\.3\n\Z/);

$prog = q{
	use strict;
	use warnings;

	use lib 'lib', 't/lib';
	use Test::Most qw<defer_plan>;

	ok(1);
	ok(1);
	ok(1);
	all_done(4);
};
stdout_like(['perl', '-e', $prog], qr/1\.\.4\n\Z/);
all_done(3);