8000 Use The Jawn Parser For Parsing Sorted Output In Tests by isomarcte · Pull Request #1997 · circe/circe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use The Jawn Parser For Parsing Sorted Output In Tests #1997

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

Merged
merged 5 commits into from
Jul 13, 2022

Conversation

isomarcte
Copy link
Contributor

Fixes #1911

The JSON.parse call on native JS automatically and always sorts the keys when parsing, but slightly differently than the ordering prescribed by Order[String]. This causes tests on the sorted printers to fail under certain circumstances.

The fix for this is to use Jawn on JS to get consistent parsing. If we switch to Jawn in general for both JS and the JVM then we can undo this.

Note, the issue has never been with the printing, but always with the parsing.

Fixes circe#1911

The `JSON.parse` call on native JS automatically and always sorts the keys when parsing, but slightly differently than the ordering prescribed by `Order[String]`. This causes tests on the sorted printers to fail under certain circumstances.

The fix for this is to use Jawn on JS to get consistent parsing. If we switch to Jawn in general for both JS and the JVM then we can undo this.

Note, the issue has never been with the printing, but always with the parsing.
@isomarcte isomarcte requested a review from zarthross as a code owner July 11, 2022 22:21
@armanbilge
Copy link
Contributor

Linking to #1941, where I proposed we switch to the Jawn parser on all platforms.

@codecov-commenter
Copy link
codecov-commenter commented Jul 11, 2022

Codecov Report

Merging #1997 (9da3daa) into main (976de0a) will increase coverage by 0.07%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #1997      +/-   ##
==========================================
+ Coverage   85.94%   86.02%   +0.07%     
==========================================
  Files          74       74              
  Lines        2554     2554              
  Branches      117      120       +3     
==========================================
+ Hits         2195     2197       +2     
+ Misses        359      357       -2     
Flag Coverage Δ
2.12.15 85.81% <ø> (+0.03%) ⬆️
2.13.8 86.05% <ø> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rc/main/scala/io/circe/numbers/BiggerDecimal.scala 88.30% <0.00%> (+1.16%) ⬆️

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 976de0a...9da3daa. Read the comment docs.

@zarthross zarthross merged commit 3c74a83 into circe:main Jul 13, 2022
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.

io.circe.NoSpacesSortKeysPrinterSuite flakey spec
4 participants
0