Overview

Test2::Tools::Compare

This package provides tools for verifying deep data structures. It also provides the Compare DSL functions. See the module documentation or the sub-nav items on the bottom left for more.
State

Simple state checks

These are some shortcuts for checking the state of vars or nested elements. T() and F() may be used in nested structures, the key/element must exist, but may be undefined for F().
Directed

Directed checks


You have some control over what type of check is used:


Custom

Custom validators


Sets

Checking sets


Check that the value matches 1 OR MORE of the specified checks.


Check that the value DOES NOT match ANY of the specified checks.


Check that the value matches ALL of the specified checks.

Array

Array Checks

If we change the array, we can see how nice the diagnostics are:
Hash

Hash Checks

If we change the hash, we can see how nice the diagnostics are:
Meta

Meta Checks


Meta-checks give you the ability to check the properties of a value.



meta() is a sub that takes a coderef as its only argument (prototype).


The 4 properties above are available for any type of item.
* Except size

Object

Object checks