8
0
Files
perl-Carp-Assert-More/perl-Carp-Assert-More.spec

77 lines
2.2 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package perl-Carp-Assert-More
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name Carp-Assert-More
Name: perl-Carp-Assert-More
Version: 2.9.0
Release: 0
# v2.9.0 -> normalize -> 2.9.0
%define cpan_version v2.9.0
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}-2.9.0.tar.gz
Source1: cpanspec.yml
2025-08-12 18:12:05 +02:00
Source100: README.md
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.64
BuildRequires: perl(Test::Exception)
BuildRequires: perl(Test::More) >= 0.72
%{perl_requires}
%description
Accepting request 913790 from devel:languages:perl:autoupdate - updated to 2.0.1 see /usr/share/doc/packages/perl-Carp-Assert-More/Changes 2.0.1 [FIXES] assert_all_keys_in() mistakenly required a non-empty list of keys to check. [ENHANCEMENTS] Sped up assert_isa_in(), assert_is(). 2.0.0 [DIFFERENCES] Now requires Perl 5.10 or higher. No longer requires Carp::Assert. The numeric functions are more stringent now. If it expects a number, then you need to pass a number. For example, assert_nonnegative($x) would pass if $x was a non-numeric string. Now it must be numeric. assert_empty() and assert_nonempty() no longer gives a message of "Not an array or hash reference". If you don't pass an array or hash reference, the assertion will just fail with the message passe3d in. assert_aoh() and assert_datetime() no longer provide a default message. assert_in() is more strict. Each element of the target array is checked to not be a reference. assert_exists() and assert_lacks() are more strict. The list of keys to check cannot be empty. [ENHANCEMENTS] Most of the functions are about twice as fast because of reduced number of function calls internally. Added assert_context_nonvoid() and assert_context_scalar() to assert on how the executing function has been called. assert_in() now lets you use undef as both the needle and one of the values in the haystack. OBS-URL: https://build.opensuse.org/request/show/913790 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Carp-Assert-More?expand=0&rev=19
2021-08-23 14:05:43 +00:00
Carp::Assert::More is a convenient set of assertions to make the habit of
writing assertions even easier.
Everything in here is effectively syntactic sugar. There's no technical
Accepting request 913790 from devel:languages:perl:autoupdate - updated to 2.0.1 see /usr/share/doc/packages/perl-Carp-Assert-More/Changes 2.0.1 [FIXES] assert_all_keys_in() mistakenly required a non-empty list of keys to check. [ENHANCEMENTS] Sped up assert_isa_in(), assert_is(). 2.0.0 [DIFFERENCES] Now requires Perl 5.10 or higher. No longer requires Carp::Assert. The numeric functions are more stringent now. If it expects a number, then you need to pass a number. For example, assert_nonnegative($x) would pass if $x was a non-numeric string. Now it must be numeric. assert_empty() and assert_nonempty() no longer gives a message of "Not an array or hash reference". If you don't pass an array or hash reference, the assertion will just fail with the message passe3d in. assert_aoh() and assert_datetime() no longer provide a default message. assert_in() is more strict. Each element of the target array is checked to not be a reference. assert_exists() and assert_lacks() are more strict. The list of keys to check cannot be empty. [ENHANCEMENTS] Most of the functions are about twice as fast because of reduced number of function calls internally. Added assert_context_nonvoid() and assert_context_scalar() to assert on how the executing function has been called. assert_in() now lets you use undef as both the needle and one of the values in the haystack. OBS-URL: https://build.opensuse.org/request/show/913790 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Carp-Assert-More?expand=0&rev=19
2021-08-23 14:05:43 +00:00
difference between calling one of these functions:
Accepting request 913790 from devel:languages:perl:autoupdate - updated to 2.0.1 see /usr/share/doc/packages/perl-Carp-Assert-More/Changes 2.0.1 [FIXES] assert_all_keys_in() mistakenly required a non-empty list of keys to check. [ENHANCEMENTS] Sped up assert_isa_in(), assert_is(). 2.0.0 [DIFFERENCES] Now requires Perl 5.10 or higher. No longer requires Carp::Assert. The numeric functions are more stringent now. If it expects a number, then you need to pass a number. For example, assert_nonnegative($x) would pass if $x was a non-numeric string. Now it must be numeric. assert_empty() and assert_nonempty() no longer gives a message of "Not an array or hash reference". If you don't pass an array or hash reference, the assertion will just fail with the message passe3d in. assert_aoh() and assert_datetime() no longer provide a default message. assert_in() is more strict. Each element of the target array is checked to not be a reference. assert_exists() and assert_lacks() are more strict. The list of keys to check cannot be empty. [ENHANCEMENTS] Most of the functions are about twice as fast because of reduced number of function calls internally. Added assert_context_nonvoid() and assert_context_scalar() to assert on how the executing function has been called. assert_in() now lets you use undef as both the needle and one of the values in the haystack. OBS-URL: https://build.opensuse.org/request/show/913790 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Carp-Assert-More?expand=0&rev=19
2021-08-23 14:05:43 +00:00
assert_datetime( $foo );
assert_isa( $foo, 'DateTime' );
Accepting request 913790 from devel:languages:perl:autoupdate - updated to 2.0.1 see /usr/share/doc/packages/perl-Carp-Assert-More/Changes 2.0.1 [FIXES] assert_all_keys_in() mistakenly required a non-empty list of keys to check. [ENHANCEMENTS] Sped up assert_isa_in(), assert_is(). 2.0.0 [DIFFERENCES] Now requires Perl 5.10 or higher. No longer requires Carp::Assert. The numeric functions are more stringent now. If it expects a number, then you need to pass a number. For example, assert_nonnegative($x) would pass if $x was a non-numeric string. Now it must be numeric. assert_empty() and assert_nonempty() no longer gives a message of "Not an array or hash reference". If you don't pass an array or hash reference, the assertion will just fail with the message passe3d in. assert_aoh() and assert_datetime() no longer provide a default message. assert_in() is more strict. Each element of the target array is checked to not be a reference. assert_exists() and assert_lacks() are more strict. The list of keys to check cannot be empty. [ENHANCEMENTS] Most of the functions are about twice as fast because of reduced number of function calls internally. Added assert_context_nonvoid() and assert_context_scalar() to assert on how the executing function has been called. assert_in() now lets you use undef as both the needle and one of the values in the haystack. OBS-URL: https://build.opensuse.org/request/show/913790 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Carp-Assert-More?expand=0&rev=19
2021-08-23 14:05:43 +00:00
that are provided by Carp::Assert::More and calling these assertions from
Carp::Assert
assert( defined $foo );
Accepting request 913790 from devel:languages:perl:autoupdate - updated to 2.0.1 see /usr/share/doc/packages/perl-Carp-Assert-More/Changes 2.0.1 [FIXES] assert_all_keys_in() mistakenly required a non-empty list of keys to check. [ENHANCEMENTS] Sped up assert_isa_in(), assert_is(). 2.0.0 [DIFFERENCES] Now requires Perl 5.10 or higher. No longer requires Carp::Assert. The numeric functions are more stringent now. If it expects a number, then you need to pass a number. For example, assert_nonnegative($x) would pass if $x was a non-numeric string. Now it must be numeric. assert_empty() and assert_nonempty() no longer gives a message of "Not an array or hash reference". If you don't pass an array or hash reference, the assertion will just fail with the message passe3d in. assert_aoh() and assert_datetime() no longer provide a default message. assert_in() is more strict. Each element of the target array is checked to not be a reference. assert_exists() and assert_lacks() are more strict. The list of keys to check cannot be empty. [ENHANCEMENTS] Most of the functions are about twice as fast because of reduced number of function calls internally. Added assert_context_nonvoid() and assert_context_scalar() to assert on how the executing function has been called. assert_in() now lets you use undef as both the needle and one of the values in the haystack. OBS-URL: https://build.opensuse.org/request/show/913790 OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Carp-Assert-More?expand=0&rev=19
2021-08-23 14:05:43 +00:00
assert( ref($foo) eq 'DateTime' );
My intent here is to make common assertions easy so that we as programmers
have no excuse to not use them.
%prep
%autosetup -n %{cpan_name}-2.9.0 -p1
%build
perl Makefile.PL INSTALLDIRS=vendor
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README.md
%changelog