Problem
mix test in wick/ emits one compiler warning:
warning: pattern matching on 0.0 is equivalent to matching only on +0.0 from Erlang/OTP 27+.
Instead you must match on +0.0 or -0.0
└─ test/wick/json_test.exs: Wick.JsonTest."test decode/1 — primitives decodes floats
including negative and exponent forms"/1
mix check runs mix compile --warnings-as-errors, but that compiles lib/, so the test
file's warning does not fail the build — it just sits there on every run. The repo is
otherwise warning-clean and credo --strict finds nothing across both libraries, so this is
the one blemish.
Fix
Change the pattern in test/wick/json_test.exs to +0.0 (or -0.0, whichever the case
intends — worth checking, since decoding "-0.0" should arguably yield -0.0 and that
distinction is exactly what the warning is about).
While there: it is worth asserting the sign explicitly, since +0.0 == -0.0 is true in
Elixir and assert decoded == 0.0 would pass either way. assert decoded === -0.0 is the
test that actually means something.
Good first issue.
Problem
mix testinwick/emits one compiler warning:mix checkrunsmix compile --warnings-as-errors, but that compileslib/, so the testfile's warning does not fail the build — it just sits there on every run. The repo is
otherwise warning-clean and
credo --strictfinds nothing across both libraries, so this isthe one blemish.
Fix
Change the pattern in
test/wick/json_test.exsto+0.0(or-0.0, whichever the caseintends — worth checking, since decoding
"-0.0"should arguably yield-0.0and thatdistinction is exactly what the warning is about).
While there: it is worth asserting the sign explicitly, since
+0.0 == -0.0is true inElixir and
assert decoded == 0.0would pass either way.assert decoded === -0.0is thetest that actually means something.
Good first issue.