Cross-platform key sorting issue #739
Closed
finestructure
started this conversation in
General
Replies: 1 comment
-
Great news: the swift 6 nightly toolchains now sort the same on Linux as on macOS and the work-around with platform specific snapshots isn't needed anymore. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've just run into a fun problem where a JSON snapshot has different key sorting (with
sortedKeys
output formatting set) between platforms. The reason is that Linux and macOS have different ideas how to sort capital letters. Specifically, macOS renders this snapshot:whereas Linux has this:
I know this isn't really a
swift-snapshot-testing
problem but I was wondering if anyone has any ideas how to deal with this.Things I'm considering:
struct
is being encoded somehow (not sure if it's possible to re-conform toCodable
and make it stick - I wouldn't mind a hack, it's inside tests only)Beta Was this translation helpful? Give feedback.
All reactions