-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(types): positive decimal from string must be finite #1210
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1210 +/- ##
==========================================
+ Coverage 70.21% 70.23% +0.02%
==========================================
Files 235 235
Lines 23975 23976 +1
==========================================
+ Hits 16833 16840 +7
Misses 5691 5691
+ Partials 1451 1445 -6
Flags with carried forward coverage won't be shown. Click here to find out more. |
Tests? |
We already have tests and they were intermittently failing without this change #1181 |
Ah, but I can add a test for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want those .fail files I think
types/math/dec_test.go
Outdated
@@ -552,6 +553,18 @@ func testIsPositive(t *rapid.T) { | |||
require.Equal(t, f > 0, dec.IsPositive()) | |||
} | |||
|
|||
// Property: isFinite(f) == isFinite(NewDecFromString(f.String())) | |||
func testIsFinite(t *rapid.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason to make this a rapid test I don't think. just create a simple unit test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Description
Closes: #1181
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change