sile / jsone

Erlang JSON library
MIT License
291 stars 71 forks source link

Don't insert newlines when encoding unknown terms using `jsone:term_to_json_string/1` #78

Closed sile closed 1 year ago

sile commented 1 year ago

Before (master branch)

> jsone:encode(list_to_tuple([{I,self()} || I <- lists:seq(1,6)])).
<<"\"{{1,<0.199.0>},\\n {2,<0.199.0>},\\n {3,<0.199.0>},\\n {4,<0.199.0>},\\n {5,<0.199.0>},\\n {6,<0.199.0>}}\"">>

After (This PR)

> jsone:encode(list_to_tuple([{I,self()} || I <- lists:seq(1,6)])).
<<"\"{{1,<0.191.0>},{2,<0.191.0>},{3,<0.191.0>},{4,<0.191.0>},{5,<0.191.0>},{6,<0.191.0>}}\"">>
sile commented 1 year ago

[NOTE] rebar3 eunit failed on OTP 25.1 due to the bug addressed in https://github.com/erlang/otp/pull/6322. I'll re-run the CI once OTP 25.1.1 is released.

codecov-commenter commented 1 year ago

Codecov Report

Merging #78 (d3cca5a) into master (e49d378) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master      #78   +/-   ##
=======================================
  Coverage   91.91%   91.91%           
=======================================
  Files           4        4           
  Lines         334      334           
=======================================
  Hits          307      307           
  Misses         27       27           
Impacted Files Coverage Δ
src/jsone.erl 82.60% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.