Replies: 4 comments 2 replies
-
Nice point, looks like a feature 👍
Why not |
Beta Was this translation helpful? Give feedback.
-
I don't see why InDelta would support 0 as an expected value while InEpsilon doesn't. It didn't occured to me to even try it . |
Beta Was this translation helpful? Give feedback.
-
@mmorel-35, I want to transfer this issue into discussion. |
Beta Was this translation helpful? Give feedback.
-
I also have a question with float compared to 0 Something was raised I a recent review when @mmorel-35 used testifylint + manual edit to fix a code using somehow var f float
assert.Equal(t, 0, f) |
Beta Was this translation helpful? Give feedback.
-
In https://github.com/argoproj/argo-cd/pull/18721/files I applyied float-compare rules .
I have two questions here.
With this first case we have situation
This suggestion
Having to convert an integer to a float to compare with a float then have to be used with
assert.InDelta
orassert.InEpsilon
.What do you think about using
Maybe this situation indicates a mistyping at the origin so the solution is to change the type of retryCount as a counter is usually an integer.
The other question is about
I was suggested to use
assert.InEpsilon
but I ended up usingThe reason behind this is that
assert.InEpsilon
doesn’t support having 0 as an expected value. The tricky thing in this situation is that desiredReplicas might not be known in certain cases.Beta Was this translation helpful? Give feedback.
All reactions