You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by va...@apache.org on 2026/04/21 04:09:20 UTC
(couchdb-jiffy) 09/49: Add extra number tests
This is an automated email from the ASF dual-hosted git repository.
nickva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/couchdb-jiffy.git
commit 8f5016201cb7c562f4a393115049aa5fdf42b31d
Author: Nick Vatamaniuc <va...@gmail.com>
AuthorDate: Tue Mar 31 00:52:38 2026 -0400
Add extra number tests
Most importantly coverage showed we didn't exercise some path in `digits10`
function. We needed large enough digits but which are smaller than bigints.
---
test/jiffy_03_number_tests.erl | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/test/jiffy_03_number_tests.erl b/test/jiffy_03_number_tests.erl
index 82f4eef..b19dffd 100644
--- a/test/jiffy_03_number_tests.erl
+++ b/test/jiffy_03_number_tests.erl
@@ -84,7 +84,14 @@ cases(ok) ->
{<<"0E3">>, 0.0, <<"0.0">>},
{<<"1.5E3">>, 1500.0, <<"1500.0">>},
{<<"2.5E-1">>, 0.25, <<"0.25">>},
- {<<"-0.325E+2">>, -32.5, <<"-32.5">>}
+ {<<"-0.325E+2">>, -32.5, <<"-32.5">>},
+ %% Large integers to exercise digits10 (11-12+ digit path)
+ {<<"10000000000">>, 10000000000},
+ {<<"100000000000">>, 100000000000},
+ {<<"-10000000000">>, -10000000000},
+ %% Number parsing edge cases
+ {<<"-0.0E1">>, -0.0, <<"0.0">>},
+ {<<"1E-1">>, 1.0e-1, <<"0.1">>}
];
cases(error) ->