2010-12-14 10:54:15 +00:00
|
|
|
#
|
2013-11-26 08:51:23 +00:00
|
|
|
# spec file for package perl-Test-Number-Delta
|
2010-12-14 10:54:15 +00:00
|
|
|
#
|
2015-04-15 05:03:15 +00:00
|
|
|
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
2010-12-14 10:54:15 +00:00
|
|
|
#
|
|
|
|
# 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 http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2010-07-25 10:03:04 +00:00
|
|
|
Name: perl-Test-Number-Delta
|
2015-04-23 05:57:11 +00:00
|
|
|
Version: 1.060000
|
2013-11-26 08:51:23 +00:00
|
|
|
Release: 0
|
2015-04-23 05:57:11 +00:00
|
|
|
%define cpan_version 1.06
|
|
|
|
Provides: perl(Test::Number::Delta) = 1.060000
|
2013-11-26 08:51:23 +00:00
|
|
|
%define cpan_name Test-Number-Delta
|
2010-07-25 10:03:04 +00:00
|
|
|
Summary: Compare the difference between numbers against a given tolerance
|
2013-11-26 08:51:23 +00:00
|
|
|
License: Apache-2.0
|
2010-07-25 10:03:04 +00:00
|
|
|
Group: Development/Libraries/Perl
|
2013-11-26 08:51:23 +00:00
|
|
|
Url: http://search.cpan.org/dist/Test-Number-Delta/
|
2015-04-23 05:57:11 +00:00
|
|
|
Source0: http://www.cpan.org/authors/id/D/DA/DAGOLDEN/%{cpan_name}-%{cpan_version}.tar.gz
|
|
|
|
Source1: cpanspec.yml
|
2025-08-12 18:17:50 +02:00
|
|
|
Source100: README.md
|
2013-11-26 08:51:23 +00:00
|
|
|
BuildArch: noarch
|
2010-12-14 10:54:15 +00:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2013-11-26 08:51:23 +00:00
|
|
|
BuildRequires: perl
|
|
|
|
BuildRequires: perl-macros
|
2010-11-30 19:28:44 +00:00
|
|
|
%{perl_requires}
|
2010-07-25 10:03:04 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
At some point or another, most programmers find they need to compare
|
|
|
|
floating-point numbers for equality. The typical idiom is to test if the
|
2013-11-26 08:51:23 +00:00
|
|
|
absolute value of the difference of the numbers is within a desired
|
|
|
|
tolerance, usually called epsilon. This module provides such a function for
|
|
|
|
use with the Test::More manpage. Usage is similar to other test functions
|
|
|
|
described in the Test::More manpage. Semantically, the 'delta_within'
|
|
|
|
function replaces this kind of construct:
|
|
|
|
|
|
|
|
ok ( abs($p - $q) < $epsilon, '$p is equal to $q' ) or
|
|
|
|
diag "$p is not equal to $q to within $epsilon";
|
|
|
|
|
|
|
|
While there's nothing wrong with that construct, it's painful to type it
|
|
|
|
repeatedly in a test script. This module does the same thing with a single
|
|
|
|
function call. The 'delta_ok' function is similar, but either uses a global
|
|
|
|
default value for epsilon or else calculates a 'relative' epsilon on the
|
|
|
|
fly so that epsilon is scaled automatically to the size of the arguments to
|
|
|
|
'delta_ok'. Both functions are exported automatically.
|
|
|
|
|
|
|
|
Because checking floating-point equality is not always reliable, it is not
|
|
|
|
possible to check the 'equal to' boundary of 'less than or equal to
|
|
|
|
epsilon'. Therefore, Test::Number::Delta only compares if the absolute
|
|
|
|
value of the difference is *less than* epsilon (for equality tests) or
|
|
|
|
*greater than* epsilon (for inequality tests).
|
2010-07-25 10:03:04 +00:00
|
|
|
|
|
|
|
%prep
|
2015-04-23 05:57:11 +00:00
|
|
|
%setup -q -n %{cpan_name}-%{cpan_version}
|
2010-07-25 10:03:04 +00:00
|
|
|
|
|
|
|
%build
|
2013-11-26 08:51:23 +00:00
|
|
|
%{__perl} Makefile.PL INSTALLDIRS=vendor
|
|
|
|
%{__make} %{?_smp_mflags}
|
|
|
|
|
|
|
|
%check
|
|
|
|
%{__make} test
|
2010-07-25 10:03:04 +00:00
|
|
|
|
|
|
|
%install
|
|
|
|
%perl_make_install
|
|
|
|
%perl_process_packlist
|
2013-11-26 08:51:23 +00:00
|
|
|
%perl_gen_filelist
|
2010-07-25 10:03:04 +00:00
|
|
|
|
2013-11-26 08:51:23 +00:00
|
|
|
%files -f %{name}.files
|
|
|
|
%defattr(-,root,root,755)
|
2015-04-15 05:03:15 +00:00
|
|
|
%doc Changes CONTRIBUTING.mkdn LICENSE README
|
2010-07-25 10:03:04 +00:00
|
|
|
|
2010-12-14 10:54:15 +00:00
|
|
|
%changelog
|