Skip to content

Translate ByteToMessageDecoderVerifierTest to Swift Testing - #3730

Merged
fabianfett merged 3 commits into
apple:mainfrom
fabianfett:ff-ByteToMessageDecoderVerifierTest
Sep 3, 2026
Merged

fabianfett merged 3 commits into
apple:mainfrom
fabianfett:ff-ByteToMessageDecoderVerifierTest

Conversation

@fabianfett

Copy link
Copy Markdown
Member

Motivation

We want to extend ByteToMessageDecoderVerifierTest with tests that verify non-copyable decoders. Instead of adding more XCTests, lets first move all existing tests to swift-testing.

Changes

  • Mechanical translation of ByteToMessageDecoderVerifierTest from XCTest to Swift Testing.

Result

No behaviour change. We can write the new tests in Swift Testing.

### Motivation

We want to extend `ByteToMessageDecoderVerifierTest` with tests that
verify non-copyable decoders. Instead of adding more XCTests, lets first move all existing tests to swift-testing.

### Changes

- Mechanical translation of `ByteToMessageDecoderVerifierTest` from
  XCTest to Swift Testing.

### Result

No behaviour change. We can write the new tests in Swift Testing.
@fabianfett fabianfett added the semver/none No version bump required. label Sep 3, 2026
}

XCTAssertThrowsError(
let error = #expect(throws: VerificationError.self) {

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.

We should just replace this with:

Suggested change
let error = #expect(throws: VerificationError.self) {
let error = try #require(throws: VerificationError.self) {

Then we can get rid of guard let error else { return } a few lines below.

This will require marking the test function itself as throws.

Same applies for the other tests below.

@fabianfett
fabianfett requested a review from aryan-25 September 3, 2026 14:15
@fabianfett
fabianfett enabled auto-merge (squash) September 3, 2026 14:30
@fabianfett
fabianfett merged commit 082e059 into apple:main Sep 3, 2026
53 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants