From fee4996ff929f4c738f563c76f7bd00708b3808d Mon Sep 17 00:00:00 2001 From: Jeancarlo Date: Fri, 6 Dec 2024 12:02:52 -0500 Subject: [PATCH] fix: dec nan cannot be finate given that it gives an werror --- types/math/dec_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/types/math/dec_test.go b/types/math/dec_test.go index b921435a09..699a8e6506 100644 --- a/types/math/dec_test.go +++ b/types/math/dec_test.go @@ -606,9 +606,10 @@ func TestIsFinite(t *testing.T) { require.True(t, a.IsFinite()) b, err := NewDecFromString("NaN") - require.NoError(t, err) - - require.False(t, b.IsFinite()) + require.EqualError(t, err, "not a number: invalid decimal string") + // empty decimal has finite form by default + b, err = NewDecFromString("") + require.True(t, b.IsFinite()) } func TestReduce(t *testing.T) {