Skip to content

Equatable SocketAddressError#3119

Merged
Lukasa merged 2 commits into
apple:mainfrom
0xTim:equatable-socketaddress-error
Feb 23, 2025
Merged

Equatable SocketAddressError#3119
Lukasa merged 2 commits into
apple:mainfrom
0xTim:equatable-socketaddress-error

Conversation

@0xTim

@0xTim 0xTim commented Feb 23, 2025

Copy link
Copy Markdown
Contributor

Make SocketAddressError Equatable. This is useful when running tests that you expect to throw this error as it allows you to write for example

await #expect(throws: SocketAddressError.unknown(host: "127.0.0.1", port: Int.max)) {
    try await app.startup()
}

@Lukasa Lukasa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let’s make it Hashable while we’re here.

@Lukasa Lukasa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, thanks Tim!

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Feb 23, 2025
@Lukasa Lukasa enabled auto-merge (squash) February 23, 2025 20:59
@Lukasa Lukasa merged commit 6c44e2d into apple:main Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🆕 semver/minor Adds new public API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants