Hello community, here is the log from the commit of package perl-Test-Differences for openSUSE:Factory checked in at 2015-02-10 20:23:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Test-Differences (Old) and /work/SRC/openSUSE:Factory/.perl-Test-Differences.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Test-Differences" Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Test-Differences/perl-Test-Differences.changes 2014-09-17 17:25:43.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Test-Differences.new/perl-Test-Differences.changes 2015-02-10 20:23:40.000000000 +0100 @@ -1,0 +2,8 @@ +Sat Feb 7 16:23:02 UTC 2015 - co...@suse.com + +- updated to 0.63 + - Minor doco-fixes + - Remove use of flatten, always use Data::Dumper for saner, more readable + output, fixes RT #95446 (David Precious (bigpresh)) + +------------------------------------------------------------------- Old: ---- Test-Differences-0.62.tar.gz New: ---- Test-Differences-0.63.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Test-Differences.spec ++++++ --- /var/tmp/diff_new_pack.0nJtqX/_old 2015-02-10 20:23:41.000000000 +0100 +++ /var/tmp/diff_new_pack.0nJtqX/_new 2015-02-10 20:23:41.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package perl-Test-Differences # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: perl-Test-Differences -Version: 0.62 +Version: 0.63 Release: 0 %define cpan_name Test-Differences Summary: Test strings and data structures and show differences if not ok ++++++ Test-Differences-0.62.tar.gz -> Test-Differences-0.63.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/Changes new/Test-Differences-0.63/Changes --- old/Test-Differences-0.62/Changes 2014-06-25 18:44:06.000000000 +0200 +++ new/Test-Differences-0.63/Changes 2014-11-20 22:43:47.000000000 +0100 @@ -1,5 +1,10 @@ Changes file for Test::Differences +0.63 Thu November 20, 2014 + - Minor doco-fixes + - Remove use of flatten, always use Data::Dumper for saner, more readable + output, fixes RT #95446 (David Precious (bigpresh)) + 0.62 Wed June 25, 2014 - Production release diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/MANIFEST new/Test-Differences-0.63/MANIFEST --- old/Test-Differences-0.62/MANIFEST 2014-06-25 18:50:12.000000000 +0200 +++ new/Test-Differences-0.63/MANIFEST 2014-11-20 22:48:37.000000000 +0100 @@ -5,7 +5,6 @@ MANIFEST README t/00-load.t -t/flatten.t t/text_vs_data.t t/pass.t t/struct.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/META.json new/Test-Differences-0.63/META.json --- old/Test-Differences-0.62/META.json 2014-06-25 18:50:12.000000000 +0200 +++ new/Test-Differences-0.63/META.json 2014-11-20 22:48:37.000000000 +0100 @@ -4,7 +4,7 @@ "David Cantrell <da...@cantrell.org.uk>" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150", + "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921", "license" : [ "unknown" ], @@ -22,28 +22,24 @@ "prereqs" : { "build" : { "requires" : { - "ExtUtils::MakeMaker" : 0 + "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { - "ExtUtils::MakeMaker" : 0 + "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "Capture::Tiny" : "0.24", "Data::Dumper" : "2.126", - "Test::More" : 0, + "Test::More" : "0", "Text::Diff" : "0.35" } } }, "release_status" : "stable", - "resources" : { - "repository" : { - "url" : "https://github.com/Ovid/Test-Differences" - } - }, - "version" : "0.62" + "resources" : {}, + "version" : "0.63" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/META.yml new/Test-Differences-0.63/META.yml --- old/Test-Differences-0.62/META.yml 2014-06-25 18:50:12.000000000 +0200 +++ new/Test-Differences-0.63/META.yml 2014-11-20 22:48:37.000000000 +0100 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: 0 dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150' +generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921' license: unknown meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -22,6 +22,5 @@ Data::Dumper: 2.126 Test::More: 0 Text::Diff: 0.35 -resources: - repository: https://github.com/Ovid/Test-Differences -version: 0.62 +resources: {} +version: 0.63 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/Makefile.PL new/Test-Differences-0.63/Makefile.PL --- old/Test-Differences-0.62/Makefile.PL 2014-06-25 18:32:27.000000000 +0200 +++ new/Test-Differences-0.63/Makefile.PL 2014-11-20 22:42:29.000000000 +0100 @@ -23,7 +23,15 @@ dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, clean => { FILES => 'Test-Differences-*' }, META_MERGE => { - resources => - { repository => 'https://github.com/Ovid/Test-Differences' } + resources => { + repository => { + type => 'git', + url => 'https://github.com/Ovid/Test-Differences.git', + web => 'https://github.com/Ovid/Test-Differences', + }, + bugtracker => { + web => 'https://github.com/Ovid/Test-Differences/issues', + }, + }, }, ); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/lib/Test/Differences.pm new/Test-Differences-0.63/lib/Test/Differences.pm --- old/Test-Differences-0.62/lib/Test/Differences.pm 2014-06-25 18:43:13.000000000 +0200 +++ new/Test-Differences-0.63/lib/Test/Differences.pm 2014-11-20 22:43:57.000000000 +0100 @@ -112,37 +112,6 @@ and other Test::Builder based testing modules. As the SYNOPSIS shows, another testing module must be used as the basis for your test suite. -These functions assume that you are presenting it with "flat" records, -looking like: - - - scalars composed of record-per-line - - arrays of scalars, - - arrays of arrays of scalars, - - arrays of hashes containing only scalars - -All of these are flattened in to single strings which are then compared -for differences. Differently data structures can be compared, as long -as they flatten identically. - -All other data structures are run through Data::Dumper first. This is a -bit dangerous, as some versions of perl shipped with Data::Dumpers that -could do the oddest things with unexpected, like core dump. Only as of -5.8.0 does Data::Dumper sort hash keys, which is necessary for HASH -dumps to be fully predictable. This will be changed when this bites -somebody or I get some free time. - -C<eq_or_diff()> starts counting records at 0 unless you pass it two text -strings: - - eq_or_diff $a, $b; ## First line is line number 1 - eq_or_diff @a, @b; ## First element is element 0 - eq_or_diff $a, @b; ## First line/element is element 0 - -If you want to force a first record number of 0, use C<eq_or_diff_data>. If -you want to force a first record number of 1, use C<eq_or_diff_text>. I chose -this over passing in an options hash because it's clearer and simpler this way. -YMMV. - =head1 OPTIONS The options to C<eq_or_diff> give some fine-grained control over the output. @@ -353,7 +322,7 @@ =cut -our $VERSION = "0.62"; # or "0.001_001" for a dev release +our $VERSION = "0.63"; # or "0.001_001" for a dev release $VERSION = eval $VERSION; use Exporter; @@ -373,21 +342,7 @@ use Carp; use Text::Diff; - -sub _isnt_ARRAY_of_scalars { - return 1 if ref ne "ARRAY"; - return scalar grep ref, @$_; -} - -sub _isnt_HASH_of_scalars { - return 1 if ref ne "HASH"; - return scalar grep ref, values %$_; -} - -use constant ARRAY_of_scalars => "ARRAY of scalars"; -use constant ARRAY_of_ARRAYs_of_scalars => "ARRAY of ARRAYs of scalars"; -use constant ARRAY_of_HASHes_of_scalars => "ARRAY of HASHes of scalars"; -use constant HASH_of_scalars => "HASH of scalars"; +use Data::Dumper; { my $diff_style = 'Table'; @@ -407,96 +362,6 @@ sub oldstyle_diff { _diff_style('OldStyle') } sub table_diff { _diff_style('Table') } -sub _grok_type { - local $_ = shift if @_; - return "SCALAR" unless ref; - if ( ref eq "ARRAY" ) { - return undef unless @$_; - return ARRAY_of_scalars - unless _isnt_ARRAY_of_scalars; - return ARRAY_of_ARRAYs_of_scalars - unless grep _isnt_ARRAY_of_scalars, @$_; - return ARRAY_of_HASHes_of_scalars - unless grep _isnt_HASH_of_scalars, @$_; - return 0; - } - elsif ( ref eq 'HASH' ) { - return HASH_of_scalars - unless _isnt_HASH_of_scalars($_); - return 0; - } -} - -## Flatten any acceptable data structure in to an array of lines. -sub _flatten { - my $type = shift; - local $_ = shift if @_; - - return [ split /^/m, _quote_str($_) ] unless ref; - - croak "Can't flatten $_" unless $type; - - ## Copy the top level array so we don't trash the originals - my ( @recs, %hash_copy ); - if ( ref $_ eq 'ARRAY' ) { - @recs = @$_; - } - elsif ( ref $_ eq 'HASH' ) { - %hash_copy = %$_; - } - else { - die "unsupported ref type"; - } - if ( $type eq ARRAY_of_scalars) { - @recs = map { _quote_str($_) } @recs; - } - elsif ( $type eq ARRAY_of_ARRAYs_of_scalars ) { - ## Also copy the inner arrays if need be - $_ = [@$_] for @recs; - } - elsif ( $type eq ARRAY_of_HASHes_of_scalars ) { - my %headings; - for my $rec (@recs) { - $headings{$_} = 1 for keys %$rec; - } - my @headings = sort keys %headings; - - ## Convert all hashes in to arrays. - for my $rec (@recs) { - $rec = [ map $rec->{$_}, @headings ],; - } - - unshift @recs, \@headings; - - $type = ARRAY_of_ARRAYs_of_scalars; - } - elsif ( $type eq HASH_of_scalars ) { - my @headings = sort keys %hash_copy; - @recs = ( \@headings, [ map $hash_copy{$_}, @headings ] ); - $type = ARRAY_of_ARRAYs_of_scalars; - } - - if ( $type eq ARRAY_of_ARRAYs_of_scalars ) { - ## Quote strings - for my $rec (@recs) { - for (@$rec) { - $_ = _quote_str($_); - } - $rec = join ",", @$rec; - } - } - - return \@recs; -} - -sub _quote_str { - my $str = shift; - return 'undef' unless defined $str; - return $str if $str =~ /^[0-9]+$/; - $str =~ s{([\\\'])}{\\$1}g; - return "'$str'"; -} - sub _identify_callers_test_package_of_choice { ## This is called at each test in case Test::Differences was used before ## the base testing modules. @@ -545,30 +410,17 @@ my @widths; - my @types = map _grok_type, @vals; - - my $dump_it = !$types[0] || !$types[1]; - - my ( $got, $expected ); - if ($dump_it) { - require Data::Dumper; - local $Data::Dumper::Indent = 1; - local $Data::Dumper::Purity = 0; - local $Data::Dumper::Terse = 1; - local $Data::Dumper::Deepcopy = 1; - local $Data::Dumper::Quotekeys = 0; - local $Data::Dumper::Sortkeys = - exists $options->{Sortkeys} ? $options->{Sortkeys} : 1; - ( $got, $expected ) = map - [ split /^/, Data::Dumper::Dumper($_) ], - @vals; - } - else { - ( $got, $expected ) = ( - _flatten( $types[0], $vals[0] ), - _flatten( $types[1], $vals[1] ) - ); - } + local $Data::Dumper::Indent = 1; + local $Data::Dumper::Purity = 0; + local $Data::Dumper::Terse = 1; + local $Data::Dumper::Deepcopy = 1; + local $Data::Dumper::Quotekeys = 0; + local $Data::Dumper::Useperl = 1; + local $Data::Dumper::Sortkeys = + exists $options->{Sortkeys} ? $options->{Sortkeys} : 1; + my ( $got, $expected ) = map + [ split /^/, Data::Dumper::Dumper($_) ], + @vals; my $caller = caller; @@ -582,8 +434,7 @@ $context = $options->{context} if exists $options->{context}; - $context = $dump_it ? 2**31 : grep( @$_ > 25, $got, $expected ) ? 3 : 25 - unless defined $context; + $context = 2**31 unless defined $context; confess "context must be an integer: '$context'\n" unless $context =~ /\A\d+\z/; @@ -671,10 +522,10 @@ =head2 C<Data::Dumper> and older Perls. Relies on Data::Dumper (for now), which, prior to perl5.8, will not always -report hashes in the same order. C< $Data::Dumper::SortKeys > I<is> set to 1, +report hashes in the same order. C< $Data::Dumper::Sortkeys > I<is> set to 1, so on more recent versions of Data::Dumper, this should not occur. Check CPAN to see if it's been peeled out of the main perl distribution and backported. -Reported by Ilya Martynov <i...@martynov.org>, although the SortKeys "future +Reported by Ilya Martynov <i...@martynov.org>, although the Sortkeys "future perfect" workaround has been set in anticipation of a new Data::Dumper for a while. Note that the two hashes should report the same here: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/t/column-headers.t new/Test-Differences-0.63/t/column-headers.t --- old/Test-Differences-0.62/t/column-headers.t 2014-06-25 18:32:27.000000000 +0200 +++ new/Test-Differences-0.63/t/column-headers.t 2014-11-20 22:42:29.000000000 +0100 @@ -17,12 +17,13 @@ " # Failed test 'both the same' # at t/script/default-headers line 8. -# +----+-------+----------+ -# | Elt|Got |Expected | -# +----+-------+----------+ -# | 0|'foo' |'foo' | -# * 1|'bar' |'baz' * -# +----+-------+----------+ +# +----+----------------+----------------+ +# | Elt|Got |Expected | +# +----+----------------+----------------+ +# | 0|{ |{ | +# * 1| foo => 'bar' | foo => 'baz' * +# | 2|} |} | +# +----+----------------+----------------+ # Looks like you failed 1 test of 1. ", "got expected error output" @@ -38,12 +39,13 @@ " # Failed test 'both the same' # at t/script/custom-headers line 8. -# +----+-------+-------+ -# | Elt|Lard |Chips | -# +----+-------+-------+ -# | 0|'foo' |'foo' | -# * 1|'bar' |'baz' * -# +----+-------+-------+ +# +----+----------------+----------------+ +# | Elt|Lard |Chips | +# +----+----------------+----------------+ +# | 0|{ |{ | +# * 1| foo => 'bar' | foo => 'baz' * +# | 2|} |} | +# +----+----------------+----------------+ # Looks like you failed 1 test of 1. ", "got expected error output" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Test-Differences-0.62/t/flatten.t new/Test-Differences-0.63/t/flatten.t --- old/Test-Differences-0.62/t/flatten.t 2014-06-25 18:32:27.000000000 +0200 +++ new/Test-Differences-0.63/t/flatten.t 1970-01-01 01:00:00.000000000 +0100 @@ -1,29 +0,0 @@ -use Test::More; - -use Test::Differences; - -sub flatten($) { - my $out = join "|", - @{ - Test::Differences::_flatten( Test::Differences::_grok_type( $_[0] ), - $_[0] ) - }; - $out =~ s/ +//g; - $out; -} -## Complex data structures are not flattened, they're dumped, so don't -## test that here. -my @cases = ( - "a" => "'a'", - "a\nb\n" => "'a\n|b\n|'", - [qw( a b )] => "'a'|'b'", - [ [qw( a b )], [qw(c d)] ] => "'a','b'|'c','d'", - [ { a => 0, b => 1 }, { a => 2, c => 3 } ] => - "'a','b','c'|0,1,undef|2,undef,3", - [ 1, undef, "undef" ] => "1|undef|'undef'", -); - -plan tests => @cases / 2; -while ( my ( $data, $result ) = splice @cases, 0, 2 ) { - is flatten $data, $result, $result; -} -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org