pointfreeco / swift-custom-dump

A collection of tools for debugging, diffing, and testing your application's data structures.
MIT License
800 stars 89 forks source link

Fix crash when diffing LocalizedStringKey with FormatStyle #98

Open daltonclaybrook opened 1 year ago

daltonclaybrook commented 1 year ago

This is a partial fix for #97. This fix covers the cases where an interpolation was appended using appendInterpolation(_:format:) but does not cover the other cases mentioned in the issue.

I attempted to fix the others as well and was able to unwrap a (Date, Text.DateStyle), but there doesn't seem to be a publicly-accessible way to use the DateStyle to format the date. Here is a gist that demonstrates unwrapping the DateStyle: https://gist.github.com/daltonclaybrook/5491f296d9d5806dd31f4d777aea347f

stephencelis commented 1 year ago

Will merge on green. Thanks for the partial fix! If you end up tackling any of the other edge cases we'd happily accept more PRs for them. We'd also accept test cases with XCTExpectFailures showing the deficiencies.