Hello community,
here is the log from the commit of package perl-Carp-Assert-More for
openSUSE:Factory checked in at 2019-07-22 17:18:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Carp-Assert-More (Old)
and /work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Carp-Assert-More"
Mon Jul 22 17:18:35 2019 rev:8 rq:717508 version:1.18
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-Carp-Assert-More/perl-Carp-Assert-More.changes
2017-08-24 18:52:43.654643849 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.4126/perl-Carp-Assert-More.changes
2019-07-22 17:18:35.865948566 +0200
@@ -1,0 +2,10 @@
+Sun Jul 21 11:10:54 UTC 2019 - Stephan Kulow <[email protected]>
+
+- updated to 1.18
+ see /usr/share/doc/packages/perl-Carp-Assert-More/Changes
+
+ 1.18 Fri Jul 19 17:12:32 CDT 2019
+ [ENHANCEMENTS]
+ Added assert_aoh() for asserting an array of hashrefs.
+
+-------------------------------------------------------------------
Old:
----
Carp-Assert-More-1.16.tar.gz
New:
----
Carp-Assert-More-1.18.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Carp-Assert-More.spec ++++++
--- /var/tmp/diff_new_pack.6rOEeL/_old 2019-07-22 17:18:36.269948244 +0200
+++ /var/tmp/diff_new_pack.6rOEeL/_new 2019-07-22 17:18:36.273948240 +0200
@@ -1,7 +1,7 @@
#
# spec file for package perl-Carp-Assert-More
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 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
@@ -12,18 +12,18 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: perl-Carp-Assert-More
-Version: 1.16
+Version: 1.18
Release: 0
%define cpan_name Carp-Assert-More
-Summary: Convenience Wrappers Around Carp::Assert
+Summary: Convenience wrappers around Carp::Assert
License: Artistic-2.0
Group: Development/Libraries/Perl
-Url: http://search.cpan.org/dist/Carp-Assert-More/
+Url: https://metacpan.org/release/%{cpan_name}
Source0:
https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildArch: noarch
@@ -59,11 +59,11 @@
%setup -q -n %{cpan_name}-%{version}
%build
-%{__perl} Makefile.PL INSTALLDIRS=vendor
-%{__make} %{?_smp_mflags}
+perl Makefile.PL INSTALLDIRS=vendor
+make %{?_smp_mflags}
%check
-%{__make} test
+make test
%install
%perl_make_install
++++++ Carp-Assert-More-1.16.tar.gz -> Carp-Assert-More-1.18.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/Changes
new/Carp-Assert-More-1.18/Changes
--- old/Carp-Assert-More-1.16/Changes 2017-08-04 21:18:59.000000000 +0200
+++ new/Carp-Assert-More-1.18/Changes 2019-07-20 00:14:38.000000000 +0200
@@ -1,5 +1,9 @@
Revision history for Perl extension Carp::Assert::More.
+1.18 Fri Jul 19 17:12:32 CDT 2019
+ [ENHANCEMENTS]
+ Added assert_aoh() for asserting an array of hashrefs.
+
1.16 Fri Aug 4 14:18:51 CDT 2017
[ENHANCEMENTS]
Added the following functions:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/MANIFEST
new/Carp-Assert-More-1.18/MANIFEST
--- old/Carp-Assert-More-1.16/MANIFEST 2017-08-04 21:19:09.000000000 +0200
+++ new/Carp-Assert-More-1.18/MANIFEST 2019-07-20 00:14:58.000000000 +0200
@@ -6,6 +6,7 @@
README.md
t/00-load.t
t/assert_all_keys_in.t
+t/assert_aoh.t
t/assert_arrayref.t
t/assert_coderef.t
t/assert_defined.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/META.json
new/Carp-Assert-More-1.18/META.json
--- old/Carp-Assert-More-1.16/META.json 2017-08-04 21:19:09.000000000 +0200
+++ new/Carp-Assert-More-1.18/META.json 2019-07-20 00:14:58.000000000 +0200
@@ -52,6 +52,6 @@
"url" : "https://github.com/petdance/carp-assert-more/tree/master"
}
},
- "version" : "1.16",
+ "version" : "1.18",
"x_serialization_backend" : "JSON::PP version 2.27400"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/META.yml
new/Carp-Assert-More-1.18/META.yml
--- old/Carp-Assert-More-1.16/META.yml 2017-08-04 21:19:09.000000000 +0200
+++ new/Carp-Assert-More-1.18/META.yml 2019-07-20 00:14:58.000000000 +0200
@@ -27,5 +27,5 @@
bugtracker:
https://rt.cpan.org/Public/Dist/Display.html?Name=Carp-Assert-More
license: http://www.opensource.org/licenses/artistic-license-2.0.php
repository: https://github.com/petdance/carp-assert-more/tree/master
-version: '1.16'
+version: '1.18'
x_serialization_backend: 'CPAN::Meta::YAML version 0.012'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/More.pm
new/Carp-Assert-More-1.18/More.pm
--- old/Carp-Assert-More-1.16/More.pm 2017-08-04 21:18:59.000000000 +0200
+++ new/Carp-Assert-More-1.18/More.pm 2019-07-20 00:14:38.000000000 +0200
@@ -15,15 +15,16 @@
=head1 VERSION
-Version 1.16
+Version 1.18
=cut
BEGIN {
- $VERSION = '1.16';
+ $VERSION = '1.18';
@ISA = qw(Exporter);
@EXPORT = qw(
assert_all_keys_in
+ assert_aoh
assert_arrayref
assert_coderef
assert_defined
@@ -640,6 +641,32 @@
}
*assert_listref = *assert_arrayref;
+
+=head2 assert_aoh( $ref [, $name ] )
+
+Verifies that C<$array> is an arrayref, and that every element is a hashref.
+
+The array C<$array> can be an empty arraref and the assertion will pass.
+
+=cut
+
+sub assert_aoh {
+ my $array = shift;
+ my $msg = shift;
+
+ $msg = 'Is an array of hashes' unless defined($msg);
+
+ assert_arrayref( $array, "$msg: Is an array" );
+ my $i = 0;
+ for my $val ( @{$array} ) {
+ assert_hashref( $val, "$msg: Element $i is a hash" );
+ ++$i;
+ }
+
+ return;
+}
+
+
=head2 assert_coderef( $ref [,$name] )
Asserts that I<$ref> is defined, and is a reference to a closure.
@@ -792,7 +819,7 @@
=head1 COPYRIGHT & LICENSE
-Copyright 2005-2017 Andy Lester.
+Copyright 2005-2019 Andy Lester.
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License version 2.0.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/t/assert_aoh.t
new/Carp-Assert-More-1.18/t/assert_aoh.t
--- old/Carp-Assert-More-1.16/t/assert_aoh.t 1970-01-01 01:00:00.000000000
+0100
+++ new/Carp-Assert-More-1.18/t/assert_aoh.t 2019-07-20 00:14:38.000000000
+0200
@@ -0,0 +1,72 @@
+#!perl -Tw
+
+package Foo;
+
+sub new { my $class = shift; return bless [ { vh => 5150, r => 2112 }, { foo
=> 'bar' } ], $class }
+
+package main;
+
+use warnings;
+use strict;
+
+use Test::More tests => 8;
+
+use Carp::Assert::More;
+
+local $@;
+$@ = '';
+
+# {} is not a arrayref
+eval {
+ assert_aoh( {} );
+};
+like( $@, qr/Assertion.*failed/ );
+
+# A hashref is not a arrayref.
+my $ref = { foo => 'foo', bar => 'bar' };
+eval {
+ assert_aoh( $ref );
+};
+like( $@, qr/Assertion.*failed/ );
+
+# 3 is not a arrayref
+eval {
+ assert_aoh( 3 );
+};
+like( $@, qr/Assertion.*failed/ );
+
+# [] is a arrayref
+eval {
+ assert_aoh( [] );
+};
+is( $@, '' );
+
+# Arrayref is OK, but it doesn't contain hashrefs.
+# a ref to a list with stuff in it is a arrayref
+my @ary = ('foo', 'bar', 'baaz');
+eval {
+ assert_aoh( \@ary );
+};
+like( $@, qr/Assertion.*failed/ );
+
+# Everything in the arrayref has to be a hash.
+@ary = ( { foo => 'bar' }, 'scalar' );
+eval {
+ assert_aoh( \@ary );
+};
+like( $@, qr/Assertion.*failed/ );
+
+# sub {} is not a arrayref
+eval {
+ assert_aoh( sub {} );
+};
+like( $@, qr/Assertion.*failed/ );
+
+# The return from a constructor is an AOH so it should pass.
+eval {
+ assert_aoh( Foo->new );
+};
+is( $@, '' );
+
+done_testing();
+exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/t/assert_isa_in.t
new/Carp-Assert-More-1.18/t/assert_isa_in.t
--- old/Carp-Assert-More-1.16/t/assert_isa_in.t 2017-08-04 21:18:59.000000000
+0200
+++ new/Carp-Assert-More-1.18/t/assert_isa_in.t 2019-07-20 00:14:38.000000000
+0200
@@ -3,7 +3,7 @@
use warnings;
use strict;
-use Test::More tests => 12;
+use Test::More tests => 13;
use Carp::Assert::More;
use Test::Exception;
@@ -27,5 +27,43 @@
lives_ok { assert_isa_in( bless({}, 'y'), [ 'x' ] ) } 'Matches base class';
dies_ok { assert_isa_in( bless({}, 'x'), [ 'y' ] ) } 'Parent does not match
child';
+
+subtest assert_isa_in => sub {
+ plan tests => 8;
+
+ package a;
+ sub foo {}
+ package main;
+ my $aa = bless {}, 'a';
+
+ package b;
+ sub foo {}
+ package main;
+ my $bb = bless {}, 'b';
+
+ package c;
+ sub foo {}
+ package main;
+ my $cc = bless {}, 'c';
+
+ package d;
+ use base 'a';
+ use base 'b';
+ use base 'c';
+ package main;
+ my $dd = bless {}, 'd';
+
+ lives_ok( sub { assert_isa_in($aa, ['a']) }, 'Basic a' );
+ lives_ok( sub { assert_isa_in($aa, ['a', 'b', 'c']) }, 'Basic a, b, c' );
+ foreach my $class ( ref $aa, ref $bb, ref $cc ) {
+ lives_ok( sub { assert_isa_in($dd, [$class]) }, "Inheritance for
$class" );
+ }
+
+ my $failure_regex = qr/ssertion failed/;
+ foreach my $class ( ref $aa, ref $bb, ref $cc ) {
+ throws_ok( sub { assert_isa_in($class, ['d']) }, $failure_regex, "No
backwards-inheritance for $class" );
+ }
+};
+
done_testing();
exit 0;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Carp-Assert-More-1.16/t/test-coverage.t
new/Carp-Assert-More-1.18/t/test-coverage.t
--- old/Carp-Assert-More-1.16/t/test-coverage.t 2017-08-04 21:18:59.000000000
+0200
+++ new/Carp-Assert-More-1.18/t/test-coverage.t 2019-07-20 00:14:38.000000000
+0200
@@ -1,6 +1,6 @@
#!perl -Tw
-use Test::More tests => 32;
+use Test::More tests => 33;
use Carp::Assert::More;