Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Test-Differences for 
openSUSE:Factory checked in at 2021-05-20 19:23:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Test-Differences (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Test-Differences.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Test-Differences"

Thu May 20 19:23:41 2021 rev:15 rq:894250 version:0.68

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Test-Differences/perl-Test-Differences.changes  
    2019-03-12 09:49:30.507584782 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Test-Differences.new.2988/perl-Test-Differences.changes
    2021-05-20 19:24:06.946176682 +0200
@@ -1,0 +2,12 @@
+Wed May 19 03:09:40 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 0.68
+   see /usr/share/doc/packages/perl-Test-Differences/Changes
+
+  0.68   2021-05-18
+      - Revert undocumented change that was causing unreasonably verbose output
+        See https://github.com/DrHyde/perl-modules-Test-Differences/issues/5
+      - Improve documentation about text vs data mode and 
eq_or_diff_{text,data}
+        See https://github.com/DrHyde/perl-modules-Test-Differences/issues/8
+
+-------------------------------------------------------------------

Old:
----
  Test-Differences-0.67.tar.gz

New:
----
  Test-Differences-0.68.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Test-Differences.spec ++++++
--- /var/tmp/diff_new_pack.zmcAfV/_old  2021-05-20 19:24:07.330175057 +0200
+++ /var/tmp/diff_new_pack.zmcAfV/_new  2021-05-20 19:24:07.330175057 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Test-Differences
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,30 +16,27 @@
 #
 
 
-#Upstream:  All Rights Reserved. You may use, distribute and modify this 
software under the terms of the GNU public license, any version, or the 
Artistic license.
 %define cpan_name Test-Differences
 Name:           perl-Test-Differences
-Version:        0.67
+Version:        0.68
 Release:        0
+#Upstream:  All Rights Reserved. You may use, distribute and modify this 
software under the terms of the GNU public license, any version, or the 
Artistic license.
 Summary:        Test strings and data structures and show differences if not ok
 License:        Artistic-1.0 OR GPL-1.0-or-later
-Group:          Development/Libraries/Perl
 URL:            https://metacpan.org/release/%{cpan_name}
 Source0:        
https://cpan.metacpan.org/authors/id/D/DC/DCANTRELL/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml
+BuildArch:      noarch
 BuildRequires:  perl
 BuildRequires:  perl-macros
 BuildRequires:  perl(Capture::Tiny) >= 0.24
 BuildRequires:  perl(Data::Dumper) >= 2.126
 BuildRequires:  perl(Test::More) >= 0.88
-BuildRequires:  perl(Test::Pod) >= 1.22
-BuildRequires:  perl(Test::Pod::Coverage) >= 1.08
 BuildRequires:  perl(Text::Diff) >= 1.43
 Requires:       perl(Capture::Tiny) >= 0.24
 Requires:       perl(Data::Dumper) >= 2.126
 Requires:       perl(Test::More) >= 0.88
 Requires:       perl(Text::Diff) >= 1.43
-BuildArch:      noarch
 %{perl_requires}
 
 %description
@@ -86,14 +83,14 @@
 testing module must be used as the basis for your test suite.
 
 %prep
-%setup -q -n %{cpan_name}-%{version}
+%autosetup  -n %{cpan_name}-%{version}
 
 %build
 perl Makefile.PL INSTALLDIRS=vendor
-make %{?_smp_mflags}
+%make_build
 
 %check
-make %{?_smp_mflags} test
+make test
 
 %install
 %perl_make_install
@@ -101,7 +98,6 @@
 %perl_gen_filelist
 
 %files -f %{name}.files
-%defattr(-,root,root,755)
 %doc Changes README
 
 %changelog

++++++ Test-Differences-0.67.tar.gz -> Test-Differences-0.68.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/Changes 
new/Test-Differences-0.68/Changes
--- old/Test-Differences-0.67/Changes   2019-03-06 22:12:14.000000000 +0100
+++ new/Test-Differences-0.68/Changes   2021-05-18 22:29:32.000000000 +0200
@@ -1,5 +1,11 @@
 Changes file for Test::Differences
 
+0.68   2021-05-18
+    - Revert undocumented change that was causing unreasonably verbose output
+      See https://github.com/DrHyde/perl-modules-Test-Differences/issues/5
+    - Improve documentation about text vs data mode and eq_or_diff_{text,data}
+      See https://github.com/DrHyde/perl-modules-Test-Differences/issues/8
+
 0.67   2019-03-06
     - Correctly compare subroutine references
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/MANIFEST 
new/Test-Differences-0.68/MANIFEST
--- old/Test-Differences-0.67/MANIFEST  2019-03-06 22:13:03.000000000 +0100
+++ new/Test-Differences-0.68/MANIFEST  2021-05-18 22:33:47.000000000 +0200
@@ -21,5 +21,6 @@
 MANIFEST.SKIP
 t/unicode.t
 t/lib/Test/Differences/TestUtils/Capture.pm
+t/sub-refs.t
 META.yml                                 Module YAML meta-data (added by 
MakeMaker)
 META.json                                Module JSON meta-data (added by 
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/META.json 
new/Test-Differences-0.68/META.json
--- old/Test-Differences-0.67/META.json 2019-03-06 22:13:03.000000000 +0100
+++ new/Test-Differences-0.68/META.json 2021-05-18 22:33:47.000000000 +0200
@@ -4,9 +4,11 @@
       "David Cantrell <[email protected]>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
+   "generated_by" : "ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
-      "unknown"
+      "unknown",
+      "artistic_1",
+      "gpl_1"
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
@@ -48,6 +50,6 @@
          "url" : "https://github.com/DrHyde/Test-Differences";
       }
    },
-   "version" : "0.67",
-   "x_serialization_backend" : "JSON::PP version 2.97001"
+   "version" : "0.68",
+   "x_serialization_backend" : "JSON::PP version 4.02"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/META.yml 
new/Test-Differences-0.68/META.yml
--- old/Test-Differences-0.67/META.yml  2019-03-06 22:13:03.000000000 +0100
+++ new/Test-Differences-0.68/META.yml  2021-05-18 22:33:46.000000000 +0200
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
+generated_by: 'ExtUtils::MakeMaker version 7.56, CPAN::Meta::Converter version 
2.150010'
 license: unknown
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -25,5 +25,5 @@
 resources:
   bugtracker: https://github.com/DrHyde/Test-Differences/issues
   repository: https://github.com/DrHyde/Test-Differences
-version: '0.67'
+version: '0.68'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/Makefile.PL 
new/Test-Differences-0.68/Makefile.PL
--- old/Test-Differences-0.67/Makefile.PL       2019-02-19 22:34:21.000000000 
+0100
+++ new/Test-Differences-0.68/Makefile.PL       2021-01-22 22:44:47.000000000 
+0100
@@ -23,6 +23,7 @@
     dist       => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
     clean      => { FILES    => 'Test-Differences-*' },
     META_MERGE => {
+        license   => [ qw(artistic_1 gpl_1) ],
         resources => {
             repository => 'https://github.com/DrHyde/Test-Differences',
             bugtracker => 'https://github.com/DrHyde/Test-Differences/issues',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/lib/Test/Differences.pm 
new/Test-Differences-0.68/lib/Test/Differences.pm
--- old/Test-Differences-0.67/lib/Test/Differences.pm   2019-03-06 
21:53:03.000000000 +0100
+++ new/Test-Differences-0.68/lib/Test/Differences.pm   2021-05-18 
22:17:56.000000000 +0200
@@ -126,8 +126,30 @@
 
 =item * C<data_type>
 
-C<text> or C<data>. See C<eq_or_diff_text> and C<eq_or_diff_data> to
-understand this. You can usually ignore this.
+C<text> or C<data>. This normally defaults to C<data>. If, however, neither of
+C<$got> or C<$expected> is a reference then  it defaults to C<text>. You can
+also force one or the other by calling C<eq_or_diff_text> or
+C<eq_or_diff_data>.
+
+The difference is that in text mode lines are numbered from 1, but in data mode
+from 0 (and are refered to as 'elements' (Elt) instead of lines):
+
+    # +---+-------+----------+
+    # | Ln|Got    |Expected  |
+    # +---+-------+----------+
+    # *  1|'foo'  |'bar'     *
+    # +---+-------+----------+
+
+    # +----+---------+----+----------+
+    # | Elt|Got      | Elt|Expected  |
+    # +----+---------+----+----------+
+    # *   0|[        *   0|'bar'     *
+    # *   1|  'foo'  *    |          |
+    # *   2|]        *    |          |
+    # +----+---------+----+----------+
+
+The difference is purely cosmetic, it makes no difference to how comparisons
+are performed.
 
 =item * C<Sortkeys>
 
@@ -318,7 +340,7 @@
 
 =cut
 
-our $VERSION = "0.67"; # or "0.001_001" for a dev release
+our $VERSION = "0.68"; # or "0.001_001" for a dev release
 $VERSION = eval $VERSION;
 
 use Exporter;
@@ -388,11 +410,49 @@
 ## references and a shallow one for scalars.
 my $joint = chr(0) . "A" . chr(1);
 
+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";
+
+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;
+    }
+}
+
 sub eq_or_diff {
     my ( @vals, $name, $options );
     $options = pop if @_ > 2 && ref $_[-1];
     ( $vals[0], $vals[1], $name ) = @_;
 
+    my @types = map { _grok_type($_) } @vals;
+    my $dump_it = !$types[0] || !$types[1];
+
     my($data_type, $filename_a, $filename_b);
     if($options) {
         $data_type  = $options->{data_type};
@@ -433,7 +493,8 @@
         $context = $options->{context}
           if exists $options->{context};
 
-        $context = 2**31 unless defined $context;
+        $context = $dump_it ? 2**31 : grep( @$_ > 25, $got, $expected ) ? 3 : 
25
+            unless defined $context;
 
         confess "context must be an integer: '$context'\n"
           unless $context =~ /\A\d+\z/;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Test-Differences-0.67/t/sub-refs.t 
new/Test-Differences-0.68/t/sub-refs.t
--- old/Test-Differences-0.67/t/sub-refs.t      1970-01-01 01:00:00.000000000 
+0100
+++ new/Test-Differences-0.68/t/sub-refs.t      2019-03-06 22:02:19.000000000 
+0100
@@ -0,0 +1,51 @@
+use strict;
+use warnings;
+
+use lib 't/lib';
+use Test::Differences::TestUtils::Capture;
+
+use Test::More;
+use Test::Differences;
+
+my $stderr = capture_error { system (
+    $^X, (map { "-I$_" } (@INC)),
+    qw(-Mstrict -Mwarnings -MTest::More -MTest::Differences),
+    '-e', '
+        END { done_testing(); }
+        eq_or_diff(sub{1}, sub{2})
+    '
+) };
+ok(
+    $stderr eq  # perl 5.16 onwards
+'#   Failed test at -e line 4.
+# +----+-------------------+-------------------+
+# | Elt|Got                |Expected           |
+# +----+-------------------+-------------------+
+# |   0|sub {              |sub {              |
+# |   1|    use warnings;  |    use warnings;  |
+# |   2|    use strict;    |    use strict;    |
+# *   3|    1;             |    2;             *
+# |   4|}                  |}                  |
+# +----+-------------------+-------------------+
+# Looks like you failed 1 test of 1.
+' ||
+    $stderr eq # perl 5.8 to 5.14
+q{#   Failed test at -e line 4.
+# +----+------------------------+------------------------+
+# | Elt|Got                     |Expected                |
+# +----+------------------------+------------------------+
+# |   0|sub {                   |sub {                   |
+# |   1|    use warnings;       |    use warnings;       |
+# |   2|    use strict 'refs';  |    use strict 'refs';  |
+# *   3|    1;                  |    2;                  *
+# |   4|}                       |}                       |
+# +----+------------------------+------------------------+
+# Looks like you failed 1 test of 1.
+},
+    "got expected error output for different sub-refs"
+);
+
+$Test::Differences::NoDeparse = 1;
+eq_or_diff sub { 1 }, sub { 2 }, "different sub-refs ignored when NoDeparse 
turned on";
+
+done_testing;

Reply via email to