1package Log::Dispatch::TestUtil; 2use Data::Dumper; 3use strict; 4use warnings; 5use base qw(Exporter); 6 7our @EXPORT_OK = qw( 8 cmp_deeply 9 dump_one_line 10); 11 12sub cmp_deeply { 13 my ( $ref1, $ref2, $name ) = @_; 14 15 my $tb = Test::Builder->new(); 16 $tb->is_eq( dump_one_line($ref1), dump_one_line($ref2), $name ); 17} 18 19sub dump_one_line { 20 my ($value) = @_; 21 22 return Data::Dumper->new( [$value] )->Indent(0)->Sortkeys(1)->Quotekeys(0) 23 ->Terse(1)->Dump(); 24} 25 261; 27 28# ABSTRACT: Utilities used internally by Log::Dispatch for testing 29 30__END__ 31 32=head1 METHODS 33 34=over 35 36=item cmp_deeply 37 38A cheap version of Test::Deep::cmp_deeply. 39 40=item dump_one_line 41 42Dump a value to a single line using Data::Dumper. 43 44=cut 45