The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test2::Tools::EventDumper - Tool for dumping Test2::Event structures.

DESCRIPTION

This tool allows you to dump Test2::Event instances (including subclasses). The dump format is the Test2::Tools::Compare event DSL. There are many configuration options available to tweak the output to meet your needs.

SYNOPSYS

use strict;
use warnings;
use Test2::Bundle::Extended;
use Test2::API qw/intercept/;

use Test2::Tools::EventDumper;

my $events = intercept {
    ok(1, 'a');
    ok(2, 'b');
};

my $dump = dump_events $events;
print "$dump\n";

The above will print this:

array {
    event Ok => sub {
        call 'name' => 'a';
        call 'pass' => '1';
        call 'effective_pass' => '1';

        prop file => match qr{\Qbasic.t\E};
        prop line => '12';
    };

    event Ok => sub {
        call 'name' => 'b';
        call 'pass' => '1';
        call 'effective_pass' => '1';

        prop file => match qr{\Qbasic.t\E};
        prop line => '13';
    };
    end();
}

Note: There is no newline at the end of the string, '}' is the last character.

EXPORTS

SETTINGS

All settings are listed with their default values when possible.

SOURCE

The source code repository for Test2-Tools-EventDumper can be found at http://github.com/Test-More/Test2-Tools-EventDumper/.

MAINTAINERS

AUTHORS

COPYRIGHT

Copyright 2016 Chad Granum exodist7@gmail.com.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See http://dev.perl.org/licenses/