1Test::Stream::DeferredTUessetrs(C3o)ntributed Perl DocumTeenstta:t:iSotnream::DeferredTests(3)
2
3
4
6 Test::Stream::DeferredTests - Write tests that get executaed at a later
7 time
8
10 This distribution is deprecated in favor of Test2, Test2::Suite, and
11 Test2::Workflow.
12
13 See Test::Stream::Manual::ToTest2 for a conversion guide.
14
16 Sometimes you need to test things BEFORE loading Test::Stream. This
17 module lets you do that. You can write tests, and then have them run
18 later, after Test::Stream is loaded. You tell it what test function to
19 run, and what arguments to give it. The function name and arguments
20 will be stored to be executed later. When ready run do_def() to kick
21 them off once the functions are defined.
22
24 use strict;
25 use warnings;
26
27 use Test::Stream::DeferredTests;
28
29 BEGIN {
30 def ok => (1, 'pass');
31 def is => ('foo', 'foo', 'runs is');
32 ...
33 }
34
35 use Test::Stream qw/Core/;
36
37 do_def(); # Run the tests
38
39 # Declare some more tests to run later:
40 def ok => (1, "another pass");
41 ...
42
43 do_def(); # run the new tests
44
45 done_testing;
46
48 def function => @args;
49 This will store the function name, and the arguments to be run
50 later. Note that each package has a separate store of tests to run.
51
52 do_def()
53 This will run all the stored tests. It will also reset the list to
54 be empty so you can add more tests to run even later.
55
57 The source code repository for Test::Stream can be found at
58 http://github.com/Test-More/Test-Stream/.
59
61 Chad Granum <exodist@cpan.org>
62
64 Chad Granum <exodist@cpan.org>
65
67 Copyright 2015 Chad Granum <exodist7@gmail.com>.
68
69 This program is free software; you can redistribute it and/or modify it
70 under the same terms as Perl itself.
71
72 See http://dev.perl.org/licenses/
73
74
75
76perl v5.38.0 2023-07-21 Test::Stream::DeferredTests(3)