-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[test] Add availability guards for tests checking behavioral changes in 5.1 #24496
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
Conversation
@swift-ci please test |
Build failed |
Array.init(unsafeUninitializedCapacity:…) back-deploys to the 5.0 stdlib, but the implementation there doesn’t catch buffer reassignment.
4bc496a
to
211aae1
Compare
@@ -77,6 +77,8 @@ StringBridgeTests.test("Tagged NSString") { | |||
|
|||
func returnOne<T>(_ t: T) -> Int { return 1 } | |||
StringBridgeTests.test("Character from NSString") { | |||
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else { return } |
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.
cc @milseman
@@ -572,6 +572,11 @@ ${Suite}.test("${ArrayType}/init(unsafeUninitializedCapacity:...:)/validCount") | |||
} | |||
|
|||
${Suite}.test("${ArrayType}/init(unsafeUninitializedCapacity:...:)/reassignBuffer") { | |||
guard #available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *) else { | |||
// When back-deployed to 5.0, this coding error does not get detected. |
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.
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.
That's… odd. Did I add that check in something that's now part of the ABI? LGTM in any case, thx @lorentey!
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.
The buffer reassign check wasn't in 5.0's underscored initializer, so code using the new public initializer won't get this check when it's deployed on macOS 10.14.2 / iOS 12.2 etc. I don't think this is a problem; the missing check won't break any working code.
Our ABI back deployment tests detected this change in behavior between the 5.0 and 5.1 stdlibs; the availability guard I added here acknowledges that this was an expected change.
@swift-ci test |
Add runtime 9999-availability guards around tests checking for behavioral changes since 5.0.
This is useful in case these tests are deployed with the 5.0 stdlib.
rdar://problem/50150948