-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Add CacheControl tests #680
Add CacheControl tests #680
Conversation
I added a fix so you PR passes all its tests |
Removed the
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #680 +/- ##
==========================================
+ Coverage 83.82% 84.00% +0.17%
==========================================
Files 117 117
Lines 7444 7444
==========================================
+ Hits 6240 6253 +13
+ Misses 1204 1191 -13 ☔ View full report in Codecov by Sentry. |
An alternative solution would be to change the |
Ok, I also removed Category.Internal as it was redundant to have the same cases for the wrapper type. |
As far as I know, the only breaking change is that a switch case over Category will produce a warning for the default case if all the cases are listed. |
Public enums in libraries are not a good idea, because adding cases to them is a breaking change. You need to wrap them in a struct to avoid the breaking change. See this pitch which will hopefully make it into swift https://forums.swift.org/t/pitch-extensible-enums-for-non-resilient-modules/77649 |
Ah,this comes up every time I forget about it... It was even mentioned in the original proposal: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0192-non-exhaustive-enums.md#allow-enums-defined-in-source-packages-to-be-considered-non-frozen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Noticed that CacheControl doesn't work with .any, tried adding XCTExpectedFailure for the failing test but apparently it is not implemented on Linux. Don't know when I'll have the time to look into fixing it, so I'm only submitting the tests for now.