Skip to content

expect_snapshot json and json2 failing for a simple reason #1309

@franzbischoff

Description

@franzbischoff

Hello,

I'm forced to use the option serialize (which is not 100% portable) because of this problem on json's:

Both uses jsonlite library, and uses the default argument digits.

This causes the following problem:

Error (test-windowfunc.R:64:5): mov_sum
Error: Serialization round-trip is not symmetric.

     value         | roundtrip
 [1] 5.7254281461  - 5.7254281500  [1]
 [2] 5.7587528272  - 5.7587528300  [2]
 [3] 5.2088458248  - 5.2088458200  [3]
 [4] 4.1113388848  - 4.1113388800  [4]
 [5] 2.6462555057  - 2.6462555100  [5]
 [6] 0.8732967544  - 0.8732967500  [6]
 [7] -1.0435459914 - -1.0435459900 [7]
 [8] -2.8678391535 - -2.8678391500 [8]
 [9] -4.3692381299 - -4.3692381300 [9]
[10] -5.4659227005 - -5.4659227000 [10]
 ... ...             ...           and 716 more ...

This could be fixed using some tolerance, right? :-)

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorsnapshot 📷

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions