Skip to content
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/unable to decode negative zero int #136

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nickccm1122
Copy link

Why

Currently this is unable to decode json with value -0(it throws error). However, {"key": -0} should be a valid JSON and gojay should be able to decode it.

What is changed

  • Found that float decoder allows to decode {"key": -0.0}. So I have change the getInt64Negative that it also allow to accept 0
  • add -0 test case for decode_number_int
  • add -0.0 test case for decode_number_float

@codecov-io
Copy link

codecov-io commented Dec 23, 2019

Codecov Report

Merging #136 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #136   +/-   ##
=======================================
  Coverage   99.96%   99.96%           
=======================================
  Files          38       38           
  Lines        5323     5323           
=======================================
  Hits         5321     5321           
  Misses          1        1           
  Partials        1        1
Impacted Files Coverage Δ
decode_number_int.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1398296...b2c358e. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants