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 2022-08-24 15:11:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-Carp-Assert-More (Old) and /work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.2083 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Carp-Assert-More" Wed Aug 24 15:11:33 2022 rev:13 rq:998966 version:2.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-Carp-Assert-More/perl-Carp-Assert-More.changes 2021-08-24 10:55:37.580261069 +0200 +++ /work/SRC/openSUSE:Factory/.perl-Carp-Assert-More.new.2083/perl-Carp-Assert-More.changes 2022-08-24 15:11:56.288549388 +0200 @@ -1,0 +2,22 @@ +Wed Aug 17 03:07:35 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 2.1.0 + see /usr/share/doc/packages/perl-Carp-Assert-More/Changes + + + 2.1.0 Mon Aug 15 19:54:27 CDT 2022 + [ENHANCEMENTS] + Add diagnostic strings to the failures. For example: + assert_nonblank( [ 'foo' ], 'This should be nonblank' ); + would fail with: + Assertion (This should be nonblank) failed! + but now fails with: + Assertion (This should be nonblank) failed! + Value is a reference to ARRAY. + Similar changes have been made to: + * assert_all_keys_in + * assert_keys_are + * assert_empty + * assert_nonempty + +------------------------------------------------------------------- Old: ---- Carp-Assert-More-2.0.1.tar.gz New: ---- Carp-Assert-More-2.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-Carp-Assert-More.spec ++++++ --- /var/tmp/diff_new_pack.X5FzbK/_old 2022-08-24 15:11:56.776549859 +0200 +++ /var/tmp/diff_new_pack.X5FzbK/_new 2022-08-24 15:11:56.784549866 +0200 @@ -1,7 +1,7 @@ # # spec file for package perl-Carp-Assert-More # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,10 +18,10 @@ %define cpan_name Carp-Assert-More Name: perl-Carp-Assert-More -Version: 2.0.1 +Version: 2.1.0 Release: 0 -Summary: Convenience assertions for common situations License: Artistic-2.0 +Summary: Convenience assertions for common situations 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 ++++++ Carp-Assert-More-2.0.1.tar.gz -> Carp-Assert-More-2.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/Changes new/Carp-Assert-More-2.1.0/Changes --- old/Carp-Assert-More-2.0.1/Changes 2021-08-13 18:58:28.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/Changes 2022-08-16 02:54:26.000000000 +0200 @@ -1,5 +1,28 @@ Revision history for Perl extension Carp::Assert::More. + +2.1.0 Mon Aug 15 19:54:27 CDT 2022 + [ENHANCEMENTS] + Add diagnostic strings to the failures. For example: + + assert_nonblank( [ 'foo' ], 'This should be nonblank' ); + + would fail with: + + Assertion (This should be nonblank) failed! + + but now fails with: + + Assertion (This should be nonblank) failed! + Value is a reference to ARRAY. + + Similar changes have been made to: + * assert_all_keys_in + * assert_keys_are + * assert_empty + * assert_nonempty + + 2.0.1 Fri Aug 13 11:57:15 CDT 2021 [FIXES] assert_all_keys_in() mistakenly required a non-empty list of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/META.json new/Carp-Assert-More-2.1.0/META.json --- old/Carp-Assert-More-2.0.1/META.json 2021-08-13 18:59:36.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/META.json 2022-08-16 02:55:47.000000000 +0200 @@ -4,7 +4,7 @@ "unknown" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.143240", + "generated_by" : "ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010", "license" : [ "artistic_2" ], @@ -48,5 +48,6 @@ "https://opensource.org/licenses/artistic-license-2.0.php" ] }, - "version" : "v2.0.1" + "version" : "v2.1.0", + "x_serialization_backend" : "JSON::PP version 2.27400" } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/META.yml new/Carp-Assert-More-2.1.0/META.yml --- old/Carp-Assert-More-2.0.1/META.yml 2021-08-13 18:59:36.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/META.yml 2022-08-16 02:55:47.000000000 +0200 @@ -7,7 +7,7 @@ configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 7.60, CPAN::Meta::Converter version 2.143240' +generated_by: 'ExtUtils::MakeMaker version 7.64, CPAN::Meta::Converter version 2.150010' license: artistic_2 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -25,4 +25,5 @@ resources: bugtracker: https://github.com/petdance/carp-assert-more/issues license: https://opensource.org/licenses/artistic-license-2.0.php -version: v2.0.1 +version: v2.1.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.0.1/More.pm new/Carp-Assert-More-2.1.0/More.pm --- old/Carp-Assert-More-2.0.1/More.pm 2021-08-13 18:57:51.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/More.pm 2022-08-16 02:49:00.000000000 +0200 @@ -14,12 +14,12 @@ =head1 VERSION -Version 2.0.1 +Version 2.1.0 =cut BEGIN { - $VERSION = '2.0.1'; + $VERSION = '2.1.0'; @ISA = qw(Exporter); @EXPORT = qw( assert_all_keys_in @@ -115,7 +115,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -136,7 +136,7 @@ return if defined($string) && defined($unmatch) && ($string ne $unmatch); require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -160,7 +160,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -184,7 +184,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -198,7 +198,7 @@ return if defined( $_[0] ); require Carp; - &Carp::confess( _fail_msg($_[1]) ); + &Carp::confess( _failure_msg($_[1]) ); } @@ -212,7 +212,7 @@ return unless defined( $_[0] ); require Carp; - &Carp::confess( _fail_msg($_[1]) ); + &Carp::confess( _failure_msg($_[1]) ); } =head2 assert_nonblank( $this [, $name] ) @@ -225,12 +225,22 @@ my $this = shift; my $name = shift; - if ( defined($this) && !ref($this) ) { - return if $this ne ''; + my $why; + if ( !defined($this) ) { + $why = 'Value is undef.'; + } + else { + if ( ref($this) ) { + $why = 'Value is a reference to ' . ref($this) . '.'; + } + else { + return if $this ne ''; + $why = 'Value is blank.'; + } } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name, $why) ); } @@ -250,7 +260,7 @@ return if Scalar::Util::looks_like_number( $n ); require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -274,7 +284,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -297,7 +307,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -320,7 +330,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -345,7 +355,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -367,7 +377,7 @@ return if defined($this) && ($this+0 < 0); require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -390,7 +400,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -414,7 +424,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -437,7 +447,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -460,7 +470,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -485,7 +495,7 @@ return if ref($this) eq $type; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -509,7 +519,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -544,15 +554,27 @@ $underlying_type = ref( $ref ); } + my $why; + my $n; if ( $underlying_type eq 'HASH' ) { return if scalar keys %{$ref} == 0; + $n = scalar keys %{$ref}; + $why = "Hash contains $n key"; } elsif ( $underlying_type eq 'ARRAY' ) { return if @{$ref} == 0; + $n = scalar @{$ref}; + $why = "Array contains $n element"; + } + else { + $why = 'Argument is not a hash or array.'; } + $why .= 's' if $n && ($n>1); + $why .= '.'; + require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name, $why) ); } @@ -587,15 +609,22 @@ $underlying_type = ref( $ref ); } + my $why; + my $n; if ( $underlying_type eq 'HASH' ) { return if scalar keys %{$ref} > 0; + $why = "Hash contains 0 keys."; } elsif ( $underlying_type eq 'ARRAY' ) { return if scalar @{$ref} > 0; + $why = "Array contains 0 elements."; + } + else { + $why = 'Argument is not a hash or array.'; } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name, $why) ); } @@ -613,7 +642,7 @@ return unless ref( $this ); require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -647,7 +676,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -667,7 +696,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -696,7 +725,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } *assert_listref = *assert_arrayref; @@ -716,7 +745,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -746,7 +775,7 @@ return if $ok; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -765,7 +794,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -786,7 +815,7 @@ } require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -849,7 +878,7 @@ return if $found; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -897,7 +926,7 @@ return if $ok; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -945,7 +974,7 @@ return if $ok; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -966,6 +995,7 @@ my $keys = shift; my $name = shift; + my $why; my $ok = 0; if ( ref($hash) eq 'HASH' || (Scalar::Util::blessed( $hash ) && $hash->isa( 'HASH' )) ) { if ( ref($keys) eq 'ARRAY' ) { @@ -974,16 +1004,23 @@ for my $key ( keys %{$hash} ) { if ( !exists $keys{$key} ) { $ok = 0; + $why = qq{Key "$key" is not a valid key.}; last; } } } + else { + $why = 'Argument for array of keys is not an arrayref.'; + } + } + else { + $why = 'Argument for hash is not a hashref.'; } return if $ok; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name, $why) ); } @@ -998,28 +1035,43 @@ my $keys = shift; my $name = shift; + my $why; my $ok = 0; if ( ref($hash) eq 'HASH' || (Scalar::Util::blessed( $hash ) && $hash->isa( 'HASH' )) ) { if ( ref($keys) eq 'ARRAY' ) { my %keys = map { $_ => 1 } @{$keys}; - my @hashkeys = keys %{$hash}; - if ( scalar @hashkeys == scalar keys %keys ) { - $ok = 1; - for my $key ( @hashkeys ) { - if ( !exists $keys{$key} ) { - $ok = 0; - last; - } + # First check all the keys are allowed. + $ok = 1; + for my $key ( keys %{$hash} ) { + if ( !exists $keys{$key} ) { + $ok = 0; + $why = qq{Key "$key" is not a valid key.}; + last; } } + + # Now check that all the valid keys are represented. + for my $key ( @{$keys} ) { + if ( !exists $hash->{$key} ) { + $ok = 0; + $why = qq{Key "$key" is not in the hash.}; + last; + } + } + } + else { + $why = 'Argument for array of keys is not an arrayref.'; } } + else { + $why = 'Argument for hash is not a hashref.'; + } return if $ok; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name, $why) ); } @@ -1060,7 +1112,7 @@ return if defined($wantarray); require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -1099,7 +1151,7 @@ return if defined($wantarray) && !$wantarray; require Carp; - &Carp::confess( _fail_msg($name) ); + &Carp::confess( _failure_msg($name) ); } @@ -1115,23 +1167,27 @@ sub assert_fail(;$) { require Carp; - &Carp::confess( _fail_msg($_[0]) ); + &Carp::confess( _failure_msg($_[0]) ); } # Can't call confess() here or the stack trace will be wrong. -sub _fail_msg { - my($name) = shift; +sub _failure_msg { + my $name = shift; + my $why = shift; + my $msg = 'Assertion'; $msg .= " ($name)" if defined $name; $msg .= " failed!\n"; + $msg .= "$why\n" if defined($why); + return $msg; } =head1 COPYRIGHT & LICENSE -Copyright 2005-2021 Andy Lester. +Copyright 2005-2022 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-2.0.1/t/assert_all_keys_in.t new/Carp-Assert-More-2.1.0/t/assert_all_keys_in.t --- old/Carp-Assert-More-2.0.1/t/assert_all_keys_in.t 2021-08-13 18:57:51.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/t/assert_all_keys_in.t 2022-08-16 02:48:30.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 5; +use Test::More tests => 7; use Carp::Assert::More; @@ -28,18 +28,32 @@ throws_ok( sub { assert_all_keys_in( $monolith, \@person_keys ) }, - qr/Assertion.*failed!/, + qr/Assertion.*failed!.+Key "(depth|width)" is not a valid key\./sm, 'Monolith fails on person keys' ); throws_ok( sub { assert_all_keys_in( $monolith, [] ) }, - qr/Assertion.*failed!/, + qr/Assertion.*failed!.+Key "(depth|width|height)" is not a valid key\./sm, 'Monolith fails on empty list of keys' ); +throws_ok( + sub { assert_all_keys_in( $monolith, {} ) }, + qr/Assertion.*failed!.+Argument for array of keys is not an arrayref\./sm, + 'Fails on a non-array list of keys' +); + + +throws_ok( + sub { assert_all_keys_in( [], \@object_keys ) }, + qr/Assertion.*failed!.+Argument for hash is not a hashref\./sm, + 'Fails on a non-hashref hash' +); + + lives_ok( sub { assert_all_keys_in( {}, [] ) }, 'Empty hash and empty keys' ); exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/t/assert_empty.t new/Carp-Assert-More-2.1.0/t/assert_empty.t --- old/Carp-Assert-More-2.0.1/t/assert_empty.t 2021-08-13 15:53:20.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/t/assert_empty.t 2022-08-16 02:48:30.000000000 +0200 @@ -3,7 +3,7 @@ use warnings; use strict; -use Test::More tests => 12; +use Test::More tests => 14; use Test::Exception; use Carp::Assert::More; @@ -36,7 +36,7 @@ } NOT_AN_ARRAY: { - throws_ok( sub { assert_empty( 27 ) }, qr/Assertion failed!/ ); + throws_ok( sub { assert_nonempty( 27 ) }, qr/Assertion failed!.+Argument is not a hash or array\./sm ); } BLESSED_ARRAY: { @@ -44,7 +44,10 @@ lives_ok( sub { assert_empty( $array_object ) } ); push( @{$array_object}, 14 ); - throws_ok( sub { assert_empty( $array_object, 'Flooble' ) }, qr/\QAssertion (Flooble) failed!/ ); + throws_ok( sub { assert_empty( $array_object, 'Flooble' ) }, qr/\QAssertion (Flooble) failed!\E.+Array contains 1 element\./sm ); + + push( @{$array_object}, 43, 'Q' ); + throws_ok( sub { assert_empty( $array_object, 'Flooble' ) }, qr/\QAssertion (Flooble) failed!\E.+Array contains 3 elements\./sm ); } BLESSED_HASH: { @@ -52,7 +55,12 @@ lives_ok( sub { assert_empty( $hash_object ) } ); $hash_object->{foo} = 14; - throws_ok( sub { assert_empty( $hash_object, 'Flargle' ) }, qr/\QAssertion (Flargle) failed!/ ); + throws_ok( sub { assert_empty( $hash_object, 'Flargle' ) }, qr/\QAssertion (Flargle) failed!\E.+Hash contains 1 key\./sm ); + + $hash_object->{blu} = 28; + $hash_object->{Q} = 47; + throws_ok( sub { assert_empty( $hash_object, 'Flargle' ) }, qr/\QAssertion (Flargle) failed!\E.+Hash contains 3 keys\./sm ); } + exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/t/assert_keys_are.t new/Carp-Assert-More-2.1.0/t/assert_keys_are.t --- old/Carp-Assert-More-2.0.1/t/assert_keys_are.t 2020-10-07 05:07:41.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/t/assert_keys_are.t 2022-08-16 02:48:30.000000000 +0200 @@ -10,7 +10,7 @@ use Test::Exception; subtest assert_keys_are => sub { - plan tests => 8; + plan tests => 10; my $monolith = { depth => 1, @@ -48,14 +48,26 @@ ); throws_ok( sub { assert_keys_are( $monolith, [] ) }, - qr/Assertion.*failed/, + qr/Assertion.*failed.+Key "(depth|height|width)" is not a valid key\./sm, 'Empty key list fails for non-empty object' ); throws_ok( sub { assert_keys_are( {}, \@object_keys ) }, - qr/Assertion.*failed/, + qr/Assertion.*failed.+Key "(depth|height|width)" is not in the hash\./sm, 'Empty hash fails for non-empty key list' ); + + throws_ok( + sub { assert_keys_are( $monolith, {} ) }, + qr/Assertion.*failed!.+Argument for array of keys is not an arrayref\./sm, + 'Fails on a non-array list of keys' + ); + + throws_ok( + sub { assert_keys_are( [], \@object_keys ) }, + qr/Assertion.*failed!.+Argument for hash is not a hashref\./sm, + 'Fails on a non-hashref hash' + ); }; exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/t/assert_nonblank.t new/Carp-Assert-More-2.1.0/t/assert_nonblank.t --- old/Carp-Assert-More-2.0.1/t/assert_nonblank.t 2020-10-06 04:42:01.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/t/assert_nonblank.t 2022-08-16 02:48:30.000000000 +0200 @@ -12,14 +12,17 @@ lives_ok( sub { assert_nonblank( 3 ) } ); lives_ok( sub { assert_nonblank( 0 ) } ); -throws_ok( sub { assert_nonblank( '' ) }, qr/Assertion failed!/, q{'' is blank, with no message} ); -throws_ok( sub { assert_nonblank( '', 'flooble' ) }, qr/\QAssertion (flooble) failed!/, q{'' is blank, with message} ); +throws_ok( sub { assert_nonblank( '' ) }, qr/Assertion failed!.+Value is blank/sm, q{'' is blank, with no message} ); +throws_ok( sub { assert_nonblank( '', 'flooble' ) }, qr/\QAssertion (flooble) failed!\E.+Value is blank/sm, q{'' is blank, with message} ); -throws_ok( sub { assert_nonblank( undef ) }, qr/Assertion failed!/, q{undef is blank, with no message} ); -throws_ok( sub { assert_nonblank( undef, 'bargle' ) }, qr/\QAssertion (bargle) failed!/, q{undef is blank, with message} ); +throws_ok( sub { assert_nonblank( undef ) }, qr/Assertion failed!.+Value is undef/sm, q{undef is blank, with no message} ); +throws_ok( sub { assert_nonblank( undef, 'bargle' ) }, qr/\QAssertion (bargle) failed!\E.+Value is undef/sm, q{undef is blank, with message} ); throws_ok( sub { my $scalar = "Blah blah"; my $ref = \$scalar; assert_nonblank( $ref, 'wango' ); -}, qr/\QAssertion (wango) failed!/, 'Testing scalar ref' ); +}, qr/\QAssertion (wango) failed!\E.+Value is a reference to SCALAR/ms, 'Testing scalar ref' ); + + +exit 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Carp-Assert-More-2.0.1/t/assert_nonempty.t new/Carp-Assert-More-2.1.0/t/assert_nonempty.t --- old/Carp-Assert-More-2.0.1/t/assert_nonempty.t 2021-08-13 15:53:20.000000000 +0200 +++ new/Carp-Assert-More-2.1.0/t/assert_nonempty.t 2022-08-16 02:48:30.000000000 +0200 @@ -36,12 +36,12 @@ } NOT_AN_ARRAY: { - throws_ok( sub { assert_nonempty( 27 ) }, qr/Assertion failed!/ ); + throws_ok( sub { assert_nonempty( 27 ) }, qr/Assertion failed!.+Argument is not a hash or array\./sm ); } BLESSED_ARRAY: { my $array_object = bless( [], 'WackyPackage' ); - throws_ok( sub { assert_nonempty( $array_object, 'Flooble' ) }, qr/\QAssertion (Flooble) failed!/ ); + throws_ok( sub { assert_nonempty( $array_object, 'Flooble' ) }, qr/\QAssertion (Flooble) failed!\E.+Array contains 0 elements\./sm ); push( @{$array_object}, 14 ); lives_ok( sub { assert_nonempty( $array_object ) } ); @@ -49,8 +49,11 @@ BLESSED_HASH: { my $hash_object = bless( {}, 'WackyPackage' ); - throws_ok( sub { assert_nonempty( $hash_object, 'Flargle' ) }, qr/\QAssertion (Flargle) failed!/ ); + throws_ok( sub { assert_nonempty( $hash_object, 'Flargle' ) }, qr/\QAssertion (Flargle) failed!\E.+Hash contains 0 keys\./sm ); $hash_object->{foo} = 14; lives_ok( sub { assert_nonempty( $hash_object ) } ); } + + +exit 0