Skip to content

Commit

Permalink
fix: dec nan cannot be finate given that it gives an werror
Browse files Browse the repository at this point in the history
  • Loading branch information
JeancarloBarrios committed Dec 6, 2024
1 parent ec33dcc commit fee4996
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions types/math/dec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,10 @@ func TestIsFinite(t *testing.T) {
require.True(t, a.IsFinite())

b, err := NewDecFromString("NaN")

Check failure on line 608 in types/math/dec_test.go

View workflow job for this annotation

GitHub Actions / golangci (types)

ineffectual assignment to b (ineffassign)
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("")

Check failure on line 611 in types/math/dec_test.go

View workflow job for this annotation

GitHub Actions / golangci (types)

ineffectual assignment to err (ineffassign)
require.True(t, b.IsFinite())
}

func TestReduce(t *testing.T) {
Expand Down

0 comments on commit fee4996

Please sign in to comment.