Skip to content

Fix Dictionary ordering in TestHTTPURLResponse.test_NSCoding #5133

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

Merged
merged 1 commit into from
Nov 6, 2024

Conversation

jrflat
Copy link
Contributor

@jrflat jrflat commented Nov 6, 2024

TestHTTPURLResponse.test_NSCoding was sometimes failing after #5019 since Dictionary ordering can be unpredictable when encoding/decoding, e.g.

TestFoundation/TestHTTPURLResponse.swift:239: error: TestHTTPURLResponse.test_NSCoding : XCTAssertEqual failed: ("[AnyHashable("Content-Disposition"), AnyHashable("Content-Type")]") is not equal to ("[AnyHashable("Content-Type"), AnyHashable("Content-Disposition")]") - Archived then unarchived http url response must be equal.

This PR makes a small change to the test to compare Sets of the keys instead.

@jrflat
Copy link
Contributor Author

jrflat commented Nov 6, 2024

@swift-ci please test

@jrflat
Copy link
Contributor Author

jrflat commented Nov 6, 2024

@swift-ci please test Linux

@rintaro
Copy link
Member

rintaro commented Nov 6, 2024

swiftlang/swift#77414
@swift-ci Please test

@rintaro rintaro merged commit cb8377e into swiftlang:main Nov 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants