Test::Struct - Perl extension for testing for structural equivelence.
use Test::Struct; deep_eq($hairy_struct,$expected,'Hairy structural test'); is($x,$y); # and everything else Test::More has to offer!
Test::Struct is used for doing deep structural comparisons of two objects. The module contains only one subrotuine which is intended to be used as a mix-in with other more generic Test::Builder derived modules like Test::More or Test::Simple. The code normally uses Scalar::Util for inspecting the data, but it will also use additional fine tuned comparison tools from Data::Dump::Streamer if they are available.
Does a deep level comparison of two objects. It traverses the two structures in parallel checking as many attributes as it can for differences. If the objects differ it will output a diagnostic message containing a list of the differences it encountered before it finished the comparison. Some types of mismatch prevent further comparison so the list may not be exhaustive.
The intention of this routine is that it will pass the test only if $got is functionally identical to $expected. However, at current time there are some data types it does not handle properly, such as CODE refs.
Only deep_eq().
Test::More, Test::Builder
Yves Orton, Demerphq at the Google email service.
Copyright (C) 2005 by Yves Orton
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.
To install Test::Struct, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Struct
CPAN shell
perl -MCPAN -e shell install Test::Struct
For more information on module installation, please visit the detailed CPAN module installation guide.