Add float_compare_mode for comparing floats with epsilon
Solves https://github.com/davidpdrsn/assert-json-diff/issues/29
Hi! I have some test-cases that need to account for small differences in floating point values. The need is very similar to what's suggested in https://github.com/davidpdrsn/assert-json-diff/issues/29, so I took a stab at implementing it here.
I started out with the less verbose syntax .float_eq_epsilon(0.001), but changed it to an enum midway to try to maintain more consistency with the existing options, and make it easier to document the two cases (what happens if you specify an epsilon, and what happens if you don't). If we prefer the more concise version, that's easy to change though.
Does the approach look sensible, or am I missing some nuance?
Oh, I also had to pull in an extra dependency. Seemed reasonable to me, not trying to implement the float comparisons by hand, although it pained me to grow the list of dependencies from 2 to 3 😄
@davidpdrsn Does this implementation look reasonable to you?