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

NAME

Test::Stream::DeepCheck::State - Tracks and manages state on deep and/or recursive structure tests.

EXPERIMENTAL CODE WARNING

This is an experimental release! Test-Stream, and all its components are still in an experimental phase. This dist has been released to cpan in order to allow testers and early adopters the chance to write experimental new tools with it, or to add experimental support for it into old tools.

PLEASE DO NOT COMPLETELY CONVERT OLD TOOLS YET. This experimental release is very likely to see a lot of code churn. API's may break at any time. Test-Stream should NOT be depended on by any toolchain level tools until the experimental phase is over.

DESCRIPTION

This package is used to track the state when running deep comparisons of data structures.

METHODS

$diag = $state->render_diag()

This uses all the stored state to produce the most helpful diagnostics message it can. This diagnostic message will have the path into the structure $_->{foo}->[5]->{bar}. It will also have the filename and line number where any failed check occurred. If extra debug info is available it may also print out a line-by-line of where the structure was defined.

$arrayref = $state->path

This is a stack of Test::Stream::DeepCheck::* objects that tells us where we are in the check. An item pushes itself to this stack before recursing into more checks, it pops it when it is done.

$arrayref = $state->diag

When a check fails it adds some diagnostics information to this arrayref. Diag info should be arrayrefs with the file, the line, and the message of the diagnostic. This information is only used if there is enough of it to be useful, that is that if everything reports the same file and line number it is not displayed.

$bool = $state->strict

If this is true then strict checking is enabled. Strict checkingmeans all elements and keys must be accounted for on both sides of the check. It also turns off coderef checks and regex checks requiring them to pass an '==' instead of running them or using '=~'.

$state->set_check_diag($string)
$string = $state->check_diag

This should be the message from the check that triggered the failure, in other words the first point of failure.

$err = $state->error

This will be set if the first point of failure was a thrown exception.

$hashref = $state->seen

This is used when recursing to ensure we do not have an infinite recustion problem.

$dbg = $state->debug

File+Line info for the state. This will be an Test::Stream::DebugInfo object.

SOURCE

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

MAINTAINERS

Chad Granum <exodist@cpan.org>

AUTHORS

Chad Granum <exodist@cpan.org>

COPYRIGHT

Copyright 2015 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://www.perl.com/perl/misc/Artistic.html