Skip to content

Tests: prefer to use first rather than indexing #6503

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
May 1, 2023

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented May 1, 2023

In the case of a failure in the test, we would previously continue to perform the slice operation which will fail in the case of an Asserts runtime due to an out of bounds access. The use of first? here would unwrap or fail, allowing tests to continue execution.

In the case of a failure in the test, we would previously continue to
perform the slice operation which will fail in the case of an Asserts
runtime due to an out of bounds access.  The use of `first?` here would
unwrap or fail, allowing tests to continue execution.
@compnerd
Copy link
Member Author

compnerd commented May 1, 2023

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented May 1, 2023

@swift-ci please smoke test

delegate.clear()
delegate.prepare(expectParsing: !expectCached)

let manifest = try! loader.load(
let manifest = try XCTUnwrap(loader.load(
Copy link
Contributor

Choose a reason for hiding this comment

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

probably we don't even need XCTUnwrap?

@tomerd tomerd merged commit 6905e30 into swiftlang:main May 1, 2023
@compnerd compnerd deleted the ungifting branch May 1, 2023 16:24
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.

2 participants