From 52236f4d59f37968ee04f22aca3f0458ee6698d9 Mon Sep 17 00:00:00 2001 From: Filipe Rosset Date: Apr 15 2018 03:29:33 +0000 Subject: added upstream patch to fix tests on some platforms --- diff --git a/datamash-1.3-fix-tests.patch b/datamash-1.3-fix-tests.patch new file mode 100644 index 0000000..59a6b56 --- /dev/null +++ b/datamash-1.3-fix-tests.patch @@ -0,0 +1,69 @@ +>From d446dba317aa067440d6312d955d523129949327 Mon Sep 17 00:00:00 2001 +From: Assaf Gordon +Date: Thu, 22 Mar 2018 11:00:34 -0600 +Subject: [PATCH 1/2] tests: fix --format='%4000f' expected output + +Can be 1.000009... or 1.000008999, depending on representation. + +* tests/datamash-output-format.pl: Check only the first 5 digits. +--- + tests/datamash-output-format.pl | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/tests/datamash-output-format.pl b/tests/datamash-output-format.pl +index 52c68a2..ca99bb0 100755 +--- a/tests/datamash-output-format.pl ++++ b/tests/datamash-output-format.pl +@@ -98,12 +98,13 @@ my @Tests = + {OUT => "0" x 3999 . "1\n"}], + + # due to binary floating representation, some decimal point digits won't be +- # zero (e.g. 1.0000090000000000000000000000000523453254320000000...). +- # The OUT_SUBST replaces exactly 3994 digits (as expected from the format) ++ # zero (e.g. 1.0000090000000000000000000000000523453254320000000... or ++ # 1.000008999999...). ++ # The OUT_SUBST replaces exactly 3995 digits (as expected from the format) + # with an "X". + ['m2', '--format "%.4000f" sum 1', {IN_PIPE=>$in1}, +- {OUT => "1.000009X\n"}, +- {OUT_SUBST => 's/^(1\.000009)([0-9]{3994})$/\1X/'}], ++ {OUT => "1.00000X\n"}, ++ {OUT_SUBST => 's/^(1\.00000)([0-9]{3995})$/\1X/'}], + + ); + +-- +2.7.4 + + +>From f4871963974a96d6e69cb80b9c2fac7ff0c1d472 Mon Sep 17 00:00:00 2001 +From: Assaf Gordon +Date: Thu, 22 Mar 2018 11:18:13 -0600 +Subject: [PATCH 2/2] tests: disable --format="%a" test + +Valid output can differ (e.g. 0x8.000p-3 vs 0x1.000p+0). + +* tests/datamash-output-format.pl: Disable 'a1' test. +--- + tests/datamash-output-format.pl | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/datamash-output-format.pl b/tests/datamash-output-format.pl +index ca99bb0..5e90ae0 100755 +--- a/tests/datamash-output-format.pl ++++ b/tests/datamash-output-format.pl +@@ -90,7 +90,9 @@ my @Tests = + ['e2', '--format "%.3e" sum 1', {IN_PIPE=>$in1}, {OUT=>"1.000e+00\n"}], + + # Test Custom formats: %a +- ['a1', '--format "%0.3a" sum 1', {IN_PIPE=>$in1}, {OUT=>"0x8.000p-3\n"}], ++ # Disable the test for now. Valid output can differ (e.g. 0x8.000p-3 and ++ # 0x1.000p0 ). ++ # ['a1', '--format "%0.3a" sum 1', {IN_PIPE=>$in1}, {OUT=>"0x8.000p-3\n"}], + + + # Custom formats can use lots of memory +-- +2.7.4 + + diff --git a/datamash.spec b/datamash.spec index 0cd2d89..0a27775 100644 --- a/datamash.spec +++ b/datamash.spec @@ -14,6 +14,8 @@ Summary: A statistical, numerical and textual operations tool License: GPLv3+ URL: https://www.gnu.org/software/%{name}/ Source0: http://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.gz +#added upstream patch to fix tests on some platforms +Patch0: datamash-1.3-fix-tests.patch Provides: bundled(gnulib) BuildRequires: gettext perl(Digest::MD5) perl(Digest::SHA) perl(Data::Dumper) @@ -27,7 +29,7 @@ numeric,textual and statistical operations on input textual data files. %prep -%autosetup +%autosetup -p 1 # .UR not defined in el6 an macros %{?el6:sed -i -e 's/^.UR //g' datamash.1} @@ -71,6 +73,7 @@ fi %changelog * Sun Apr 15 2018 Filipe Rosset - 1.3-1 - new upstream release 1.3 +- added upstream patch to fix tests on some platforms * Wed Feb 07 2018 Fedora Release Engineering - 1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild