You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have some snapshot tests using some structs that include serde_json::value::RawValue fields. These tests started failing after upgrading from insta version 0.14.0 to 0.20.0. Here's an example of the diffs:
Use insta::assert_json_snapshot(MyStructWithRawValueField); with insta:1.14.0 and commit the snapshot.
Upgrade insta dependency
Observe failing test
Insta Version
1.14.0 -> 1.20.0
rustc Version
1.64
What did you expect?
I'm not entirely sure what the expected behavior should be here. The new representation actually seems reasonable from the standpoint that equality of a RawValue perhaps out to depend on the actual string representation rather than just the values of the parsed JSON. In other words, the new format causes semantically insignificant differences in the RawValue-wrapped JSON (such as whitespace) to be considered significant when comparing snapshots.
What do you think? Should this be considered a regression or a feature?
The text was updated successfully, but these errors were encountered:
Ah interesting. Serde's in-band signalling strikes again (serde-rs/serde#1463). I did not expect this but now that it happened I would probably prefer to keep it this way.
I believe fundamentally serde needs to find a better way to represent these things and I probably don't want to hack this into this library now to match the behavior.
What happened?
We have some snapshot tests using some structs that include
serde_json::value::RawValue
fields. These tests started failing after upgrading from insta version0.14.0
to0.20.0
. Here's an example of the diffs:Reproduction steps
insta::assert_json_snapshot(MyStructWithRawValueField);
withinsta:1.14.0
and commit the snapshot.Insta Version
1.14.0 -> 1.20.0
rustc Version
1.64
What did you expect?
I'm not entirely sure what the expected behavior should be here. The new representation actually seems reasonable from the standpoint that equality of a
RawValue
perhaps out to depend on the actual string representation rather than just the values of the parsed JSON. In other words, the new format causes semantically insignificant differences in theRawValue
-wrapped JSON (such as whitespace) to be considered significant when comparing snapshots.What do you think? Should this be considered a regression or a feature?
The text was updated successfully, but these errors were encountered: