1Test2::Tools::Event(3)User Contributed Perl DocumentationTest2::Tools::Event(3)
2
3
4
6 Test2::Tools::Event - Tools for generating test events.
7
9 This module provides tools for generating events quickly by bypassing
10 the context/hub. This is particularly useful when testing other Test2
11 packages.
12
14 $e = gen_event($TYPE)
15 $e = gen_event($TYPE, %FIELDS)
16 $e = gen_event 'Ok';
17 $e = gen_event Ok => ( ... )
18 $e = gen_event '+Test2::Event::Ok' => ( ... )
19 This will produce an event of the specified type. $TYPE is assumed
20 to be shorthand for "Test2::Event::$TYPE", you can prefix $TYPE
21 with a '+' to drop the assumption.
22
23 An Test2::Util::Trace will be generated using caller(0) and will be
24 put in the 'trace' field of your new event, unless you specified
25 your own 'trace' field.
26
28 The source code repository for Test2-Suite can be found at
29 https://github.com/Test-More/Test2-Suite/.
30
32 Chad Granum <exodist@cpan.org>
33
35 Chad Granum <exodist@cpan.org>
36
38 Copyright 2018 Chad Granum <exodist@cpan.org>.
39
40 This program is free software; you can redistribute it and/or modify it
41 under the same terms as Perl itself.
42
43 See http://dev.perl.org/licenses/
44
45
46
47perl v5.34.0 2021-11-16 Test2::Tools::Event(3)