summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2018-03-22 11:00:34 -0600
committerAssaf Gordon <assafgordon@gmail.com>2018-03-22 11:15:51 -0600
commitd446dba317aa067440d6312d955d523129949327 (patch)
treeaf4bf6b6659c0f56bdeb9267e21ade164bf7ad40
parent0651e1e32fea4d4f6e2fc2fb785ed27b6ef6345a (diff)
downloaddatamash-d446dba3.tar.gz
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.
-rwxr-xr-xtests/datamash-output-format.pl9
1 files 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/'}],
);