Test2-Tools-Explain-0.02/0000755000175000017500000000000012774625266013621 5ustar andyandyTest2-Tools-Explain-0.02/README.md0000644000175000017500000000067112774624743015103 0ustar andyandy# Test2::Tools::Explain, a data dumper for Test2 Test2::Suite dropped the `explain()` function that had been part of Test::More. For those who miss it in Test2, you can use Test2::Tools::Explain. use Test2::Tools::Explain; my $errors = fleeble_the_whatzit(); is( $errors, [], 'Should have no errors from fleebling' ) or diag explain( $errors ); Note that `explain` does not output anything. It returns a formatted string. Test2-Tools-Explain-0.02/MANIFEST0000644000175000017500000000043112774625266014750 0ustar andyandyChanges lib/Test2/Tools/Explain.pm Makefile.PL MANIFEST README.md t/00-load.t t/explain.t xt/manifest.t xt/pod.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) Test2-Tools-Explain-0.02/Makefile.PL0000644000175000017500000000123112774624743015567 0ustar andyandyuse 5.008001; use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( NAME => 'Test2::Tools::Explain', AUTHOR => q{Andy Lester }, VERSION_FROM => 'lib/Test2/Tools/Explain.pm', ABSTRACT_FROM => 'lib/Test2/Tools/Explain.pm', LICENSE => 'artistic_2', PL_FILES => {}, MIN_PERL_VERSION => 5.008001, CONFIGURE_REQUIRES => { 'ExtUtils::MakeMaker' => 0, }, PREREQ_PM => { 'parent' => 0, 'Test2::Suite' => 0, }, dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Test2-Tools-Explain-*' }, ); Test2-Tools-Explain-0.02/META.json0000664000175000017500000000170112774625266015243 0ustar andyandy{ "abstract" : "Explain tools for Perl's Test2 framework", "author" : [ "Andy Lester " ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.18, CPAN::Meta::Converter version 2.143240", "license" : [ "artistic_2" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : "2" }, "name" : "Test2-Tools-Explain", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Test2::Suite" : "0", "parent" : "0", "perl" : "5.008001" } } }, "release_status" : "stable", "version" : "0.02" } Test2-Tools-Explain-0.02/xt/0000755000175000017500000000000012774625266014254 5ustar andyandyTest2-Tools-Explain-0.02/xt/pod.t0000644000175000017500000000022112774060262015203 0ustar andyandy#!perl -T use 5.006; use strict; use warnings; use Test::More; # Ensure a recent version of Test::Pod use Test::Pod 1.22; all_pod_files_ok(); Test2-Tools-Explain-0.02/xt/manifest.t0000644000175000017500000000044612774060262016240 0ustar andyandy#!perl -T use 5.006; use strict; use warnings; use Test::More; my $min_tcm = 0.9; eval "use Test::CheckManifest $min_tcm"; plan skip_all => "Test::CheckManifest $min_tcm required" if $@; ok_manifest({ filter => [qr/\.git/, qr/~$/, qr/Makefile\.old/, qr/Test2-Tools-Explain/], }); Test2-Tools-Explain-0.02/t/0000755000175000017500000000000012774625266014064 5ustar andyandyTest2-Tools-Explain-0.02/t/00-load.t0000644000175000017500000000036312774060262015374 0ustar andyandy#!perl -T use 5.006; use strict; use warnings; use Test::More; plan tests => 1; BEGIN { use_ok( 'Test2::Tools::Explain' ) || print "Bail out!\n"; } diag( "Testing Test2::Tools::Explain $Test2::Tools::Explain::VERSION, Perl $], $^X" ); Test2-Tools-Explain-0.02/t/explain.t0000644000175000017500000000052012774060262015673 0ustar andyandy#!perl use strict; use warnings; use Test2::Bundle::Extended; plan 2; use Test2::Tools::Explain; imported_ok( 'explain' ); is( [ explain( 42, [ 2112, 5150, 90125 ], { fish => 'paste', bingo => \'bongo' } ) ], [ '42', <<'EOF', [ 2112, 5150, 90125 ] EOF <<'EOF' { 'bingo' => \'bongo', 'fish' => 'paste' } EOF ] ); Test2-Tools-Explain-0.02/META.yml0000664000175000017500000000105512774625266015075 0ustar andyandy--- abstract: "Explain tools for Perl's Test2 framework" author: - 'Andy Lester ' build_requires: ExtUtils::MakeMaker: '0' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.18, CPAN::Meta::Converter version 2.143240' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Test2-Tools-Explain no_index: directory: - t - inc requires: Test2::Suite: '0' parent: '0' perl: '5.008001' version: '0.02' Test2-Tools-Explain-0.02/lib/0000755000175000017500000000000012774625266014367 5ustar andyandyTest2-Tools-Explain-0.02/lib/Test2/0000755000175000017500000000000012774625266015370 5ustar andyandyTest2-Tools-Explain-0.02/lib/Test2/Tools/0000755000175000017500000000000012774625266016470 5ustar andyandyTest2-Tools-Explain-0.02/lib/Test2/Tools/Explain.pm0000644000175000017500000001040612774624743020426 0ustar andyandypackage Test2::Tools::Explain; use 5.008001; use strict; use warnings; =head1 NAME Test2::Tools::Explain -- Explain tools for Perl's Test2 framework =head1 VERSION Version 0.02 =cut our $VERSION = '0.02'; use parent 'Exporter'; our @EXPORT_OK = qw( explain ); our @EXPORT = @EXPORT_OK; =head1 SYNOPSIS L dropped the C function that had been part of Test::More. For those who miss it in Test2, you can use Test2::Tools::Explain. use Test2::Tools::Explain; my $errors = fleeble_the_whatzit(); is( $errors, [], 'Should have no errors from fleebling' ) or diag explain( $errors ); =head1 EXPORTS All functions in this module are exported by default. =head1 SUBROUTINES =head2 explain( @things_to_explain ) Will convert the contents of any references in a human readable format, and return them as strings. Usually you want to pass this into C or C. Handy for things like: is( $errors, [], 'Should have no errors' ) or diag explain( $errors ); Note that C does NOT output anything. =cut sub explain { local ($@, $!); require Data::Dumper; return map { ref $_ ? do { my $dumper = Data::Dumper->new( [$_] ); $dumper->Indent(1)->Terse(1); $dumper->Sortkeys(1) if $dumper->can('Sortkeys'); $dumper->Dump; } : $_ } @_; } =head1 AUTHOR Andy Lester, C<< >> =head1 BUGS Please report any bugs or feature requests to L. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. =head1 SUPPORT You can find documentation for this module with the perldoc command. perldoc Test2::Tools::Explain You can also look for information at: =over 4 =item * GitHub project page L =item * Search CPAN L =item * AnnoCPAN: Annotated CPAN documentation L =item * CPAN Ratings L =back =head1 ACKNOWLEDGEMENTS The code for C is originally from C by Michael Schwern, who took it from C by Curtis Poe. =head1 LICENSE AND COPYRIGHT Copyright 2016 Andy Lester. This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: L Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license. If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license. This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder. This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed. Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =cut 1; # End of Test2::Tools::Explain Test2-Tools-Explain-0.02/Changes0000644000175000017500000000032212774624743015110 0ustar andyandyRevision history for Test2-Tools-Explain 0.02 - 2016-10-03 22:48:00 CDT - First basic version just to get it up on CPAN and getting checked by Travis. [New features] - Add the explain() function.