Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Carp-Assert-More for 
openSUSE:Factory checked in at 2023-06-03 00:07:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Carp-Assert-More (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.15902 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Carp-Assert-More"

Sat Jun  3 00:07:13 2023 rev:15 rq:1090362 version:2.3.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Carp-Assert-More/perl-Carp-Assert-More.changes  
    2023-02-16 16:56:12.766787174 +0100
+++ 
/work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.15902/perl-Carp-Assert-More.changes
   2023-06-03 00:07:21.734038014 +0200
@@ -1,0 +2,14 @@
+Thu Jun  1 03:06:19 UTC 2023 - Tina Müller <[email protected]>
+
+- updated to 2.3.0
+   see /usr/share/doc/packages/perl-Carp-Assert-More/Changes
+
+  2.3.0   Tue May 30 21:52:20 CDT 2023
+          [ENHANCEMENTS]
+          Added assert_arrayref_of() to verify that all of the elements
+          in an arrayref are of a given type. For example:
+
+              my $users = get_users();
+              assert_arrayref_of( $users, 'My::User' );
+
+-------------------------------------------------------------------

Old:
----
  Carp-Assert-More-2.2.0.tar.gz

New:
----
  Carp-Assert-More-2.3.0.tar.gz

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

Other differences:
------------------
++++++ perl-Carp-Assert-More.spec ++++++
--- /var/tmp/diff_new_pack.6CVPwv/_old  2023-06-03 00:07:22.610043187 +0200
+++ /var/tmp/diff_new_pack.6CVPwv/_new  2023-06-03 00:07:22.614043210 +0200
@@ -18,7 +18,7 @@
 
 %define cpan_name Carp-Assert-More
 Name:           perl-Carp-Assert-More
-Version:        2.2.0
+Version:        2.3.0
 Release:        0
 License:        Artistic-2.0
 Summary:        Convenience assertions for common situations

++++++ Carp-Assert-More-2.2.0.tar.gz -> Carp-Assert-More-2.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/Changes 
new/Carp-Assert-More-2.3.0/Changes
--- old/Carp-Assert-More-2.2.0/Changes  2023-01-30 03:24:08.000000000 +0100
+++ new/Carp-Assert-More-2.3.0/Changes  2023-05-31 04:53:56.000000000 +0200
@@ -1,6 +1,15 @@
 Revision history for Perl extension Carp::Assert::More.
 
 
+2.3.0   Tue May 30 21:52:20 CDT 2023
+        [ENHANCEMENTS]
+        Added assert_arrayref_of() to verify that all of the elements
+        in an arrayref are of a given type. For example:
+
+            my $users = get_users();
+            assert_arrayref_of( $users, 'My::User' );
+
+
 2.2.0   Sun Jan 29 20:23:59 CST 2023
         [ENHANCEMENTS]
         Added assert_cmp( $x, $op, $y [, $msg] ), analogous to cmp_ok in 
Test::More, so you can do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/MANIFEST 
new/Carp-Assert-More-2.3.0/MANIFEST
--- old/Carp-Assert-More-2.2.0/MANIFEST 2023-01-30 03:25:34.000000000 +0100
+++ new/Carp-Assert-More-2.3.0/MANIFEST 2023-05-31 05:00:40.000000000 +0200
@@ -10,6 +10,7 @@
 t/assert_aoh.t
 t/assert_arrayref.t
 t/assert_arrayref_nonempty.t
+t/assert_arrayref_of.t
 t/assert_cmp.t
 t/assert_coderef.t
 t/assert_context_nonvoid.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/META.json 
new/Carp-Assert-More-2.3.0/META.json
--- old/Carp-Assert-More-2.2.0/META.json        2023-01-30 03:25:34.000000000 
+0100
+++ new/Carp-Assert-More-2.3.0/META.json        2023-05-31 05:00:39.000000000 
+0200
@@ -10,7 +10,7 @@
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
-      "version" : 2
+      "version" : "2"
    },
    "name" : "Carp-Assert-More",
    "no_index" : {
@@ -35,7 +35,8 @@
             "Carp" : "0",
             "Scalar::Util" : "0",
             "Test::Exception" : "0",
-            "Test::More" : "0.18"
+            "Test::More" : "0.18",
+            "perl" : "5.010001"
          }
       }
    },
@@ -44,10 +45,11 @@
       "bugtracker" : {
          "web" : "https://github.com/petdance/carp-assert-more/issues";
       },
+      "homepage" : "https://github.com/petdance/carp-assert-more";,
       "license" : [
          "https://opensource.org/licenses/artistic-license-2.0.php";
       ]
    },
-   "version" : "v2.2.0",
-   "x_serialization_backend" : "JSON::PP version 4.07"
+   "version" : "v2.3.0",
+   "x_serialization_backend" : "JSON::PP version 2.27400"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/META.yml 
new/Carp-Assert-More-2.3.0/META.yml
--- old/Carp-Assert-More-2.2.0/META.yml 2023-01-30 03:25:33.000000000 +0100
+++ new/Carp-Assert-More-2.3.0/META.yml 2023-05-31 05:00:39.000000000 +0200
@@ -22,8 +22,10 @@
   Scalar::Util: '0'
   Test::Exception: '0'
   Test::More: '0.18'
+  perl: '5.010001'
 resources:
   bugtracker: https://github.com/petdance/carp-assert-more/issues
+  homepage: https://github.com/petdance/carp-assert-more
   license: https://opensource.org/licenses/artistic-license-2.0.php
-version: v2.2.0
-x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
+version: v2.3.0
+x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/Makefile.PL 
new/Carp-Assert-More-2.3.0/Makefile.PL
--- old/Carp-Assert-More-2.2.0/Makefile.PL      2023-01-30 03:23:03.000000000 
+0100
+++ new/Carp-Assert-More-2.3.0/Makefile.PL      2023-05-31 04:23:29.000000000 
+0200
@@ -4,11 +4,13 @@
 
 use strict;
 use warnings;
-use ExtUtils::MakeMaker;
+use ExtUtils::MakeMaker 6.46;
 
 my %parms = (
     NAME                => 'Carp::Assert::More',
     VERSION_FROM        => 'More.pm', # finds $VERSION
+    LICENSE             => 'artistic_2',
+    MIN_PERL_VERSION    => '5.10.1',
 
     PM => {
         'More.pm'       => '$(INST_LIB)/Carp/Assert/More.pm',
@@ -26,21 +28,16 @@
         SUFFIX          => '.gz',
         DIST_DEFAULT    => 'all tardist',
     },
-);
-
-if ( $ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/ and 
$ExtUtils::MakeMaker::VERSION > 6.30 ) {
-    $parms{LICENSE} = 'artistic_2';
-}
 
-if ( $ExtUtils::MakeMaker::VERSION ge '6.46' ) {
-    $parms{META_MERGE} = {
+    META_MERGE => {
         resources => {
+            homepage    => 'https://github.com/petdance/carp-assert-more',
             bugtracker  => 
'https://github.com/petdance/carp-assert-more/issues',
             repository  => '[email protected]:petdance/carp-assert-more.git',
             license     => 
'https://opensource.org/licenses/artistic-license-2.0.php',
         }
-    };
-}
+    },
+);
 
 WriteMakefile( %parms );
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/More.pm 
new/Carp-Assert-More-2.3.0/More.pm
--- old/Carp-Assert-More-2.2.0/More.pm  2023-01-30 03:24:29.000000000 +0100
+++ new/Carp-Assert-More-2.3.0/More.pm  2023-05-31 04:59:45.000000000 +0200
@@ -15,18 +15,19 @@
 
 =head1 VERSION
 
-Version 2.2.0
+Version 2.3.0
 
 =cut
 
 BEGIN {
-    $VERSION = '2.2.0';
+    $VERSION = '2.3.0';
     @ISA = qw(Exporter);
     @EXPORT = qw(
         assert_all_keys_in
         assert_aoh
         assert_arrayref
         assert_arrayref_nonempty
+        assert_arrayref_of
         assert_cmp
         assert_coderef
         assert_context_nonvoid
@@ -100,7 +101,10 @@
 
 =head2 assert_is( $string, $match [,$name] )
 
-Asserts that I<$string> matches I<$match>.
+Asserts that I<$string> is the same string value as I<$match>.
+
+C<undef> is not converted to an empty string. If both strings are
+C<undef>, they match. If only one string is C<undef>, they don't match.
 
 =cut
 
@@ -123,7 +127,9 @@
 
 =head2 assert_isnt( $string, $unmatch [,$name] )
 
-Asserts that I<$string> does NOT match I<$unmatch>.
+Asserts that I<$string> does NOT have the same string value as I<$unmatch>.
+
+C<undef> is not converted to an empty string.
 
 =cut
 
@@ -144,15 +150,25 @@
 
 =head2 assert_cmp( $x, $op, $y [,$name] )
 
-Asserts that the relation C<$x $op $y> is true. For example:
+Asserts that the relation C<$x $op $y> is true. It lets you know why
+the comparsison failed, rather than simply that it did fail, by giving
+better diagnostics than a plain C<assert()>, as well as showing the
+operands in the stacktrace.
+
+Plain C<assert()>:
+
+    assert( $nitems <= 10, 'Ten items or fewer in the express lane' );
 
-    assert_cmp( $divisor, '!=', 0, 'Divisor must not be zero' );
+    Assertion (Ten items or fewer in the express lane) failed!
+    Carp::Assert::assert("", "Ten items or fewer in the express lane") called 
at foo.pl line 12
 
-is the same as:
+With C<assert_cmp()>:
 
-    assert( $divisor != 0, 'Divisor must not be zero' );
+    assert_cmp( $nitems, '<=', 10, 'Ten items or fewer in the express lane' );
 
-but with better error reporting.
+    Assertion (Ten items or fewer in the express lane) failed!
+    Failed: 14 <= 10
+    Carp::Assert::More::assert_cmp(14, "<=", 10, "Ten items or fewer in the 
express lane") called at foo.pl line 11
 
 The following operators are supported:
 
@@ -850,6 +866,51 @@
 }
 
 
+=head2 assert_arrayref_of( $ref, $type [, $name] )
+
+Asserts that I<$ref> is reference to an array that has at least one
+element in it, and every one of those elements is of type I<$type>.
+
+For example:
+
+    my @users = get_users();
+    assert_arrayref_of( \@users, 'My::User' );
+
+=cut
+
+sub assert_arrayref_of($$;$) {
+    my $ref  = shift;
+    my $type = shift;
+    my $name = shift;
+
+    my $ok;
+    my @why;
+
+    if ( ref($ref) eq 'ARRAY' || (Scalar::Util::blessed( $ref ) && $ref->isa( 
'ARRAY' )) ) {
+        if ( scalar @{$ref} > 0 ) {
+            my $n = 0;
+            for my $i ( @{$ref} ) {
+                if ( !( ( Scalar::Util::blessed( $i ) && $i->isa( $type ) ) || 
(ref($i) eq $type) ) ) {
+                    push @why, "Element #$n is not of type $type";
+                }
+                ++$n;
+            }
+            $ok = !@why;
+        }
+        else {
+            push @why, 'Array contains no elements';
+        }
+    }
+
+    if ( !$ok ) {
+        require Carp;
+        &Carp::confess( _failure_msg($name), @why );
+    }
+
+    return;
+}
+
+
 =head2 assert_aoh( $ref [, $name ] )
 
 Verifies that C<$array> is an arrayref, and that every element is a hashref.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/t/assert_arrayref_of.t 
new/Carp-Assert-More-2.3.0/t/assert_arrayref_of.t
--- old/Carp-Assert-More-2.2.0/t/assert_arrayref_of.t   1970-01-01 
01:00:00.000000000 +0100
+++ new/Carp-Assert-More-2.3.0/t/assert_arrayref_of.t   2023-05-31 
04:51:53.000000000 +0200
@@ -0,0 +1,56 @@
+#!perl -Tw
+
+package Foo;
+
+sub new { my $class = shift; return bless [@_], $class; }
+
+package main;
+
+use warnings;
+use strict;
+
+use Test::More tests => 10;
+
+use Carp::Assert::More;
+
+use Test::Exception;
+
+my $FAILED = qr/Assertion failed/;
+
+MAIN: {
+    # {} is not an arrayref.
+    throws_ok( sub { assert_arrayref_of( {}, 'Foo' ) }, $FAILED );
+
+    # A ref to a hash with stuff in it is not an arrayref.
+    my $ref = { foo => 'foo', bar => 'bar' };
+    throws_ok( sub { assert_arrayref_of( $ref, 'Foo' ) }, $FAILED );
+
+    # 3 is not an arrayref.
+    throws_ok( sub { assert_arrayref_of( 3, 'Foo' ) }, $FAILED );
+
+    # [] is a nonempty arrayref.
+    lives_ok( sub { assert_arrayref_of( [ Foo->new ], 'Foo' ) } );
+
+    # [] is an empty arrayref.
+    throws_ok( sub { assert_arrayref_of( [], 'Foo' ) }, $FAILED );
+
+    my @empty_ary = ();
+    throws_ok( sub { assert_arrayref_of( \@empty_ary, 'Foo' ) }, $FAILED );
+
+    # A coderef is not an arrayref.
+    my $coderef = sub {};
+    throws_ok( sub { assert_arrayref_of( $coderef, 'Foo' ) }, $FAILED );
+
+}
+
+WHICH_ELEMENT: {
+    lives_ok( sub { assert_arrayref_of( [ Foo->new, Foo->new ], 'Foo' ) } );
+
+    # Check for both parts of the message.
+    throws_ok( sub { assert_arrayref_of( [ Foo->new, Foo->new, {} ], 'Foo' ) 
}, $FAILED );
+    throws_ok( sub { assert_arrayref_of( [ Foo->new, Foo->new, {} ], 'Foo' ) 
}, qr/Element #2/ );
+}
+
+
+
+exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Carp-Assert-More-2.2.0/t/test-coverage.t 
new/Carp-Assert-More-2.3.0/t/test-coverage.t
--- old/Carp-Assert-More-2.2.0/t/test-coverage.t        2023-01-30 
03:23:03.000000000 +0100
+++ new/Carp-Assert-More-2.3.0/t/test-coverage.t        2023-05-31 
04:45:31.000000000 +0200
@@ -1,6 +1,6 @@
 #!perl -Tw
 
-use Test::More tests => 40;
+use Test::More tests => 41;
 
 use Carp::Assert::More;
 

Reply via email to