Skip to content

Crash when a call to confirmation(expectedCount: 1...) { ... } fails #805

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

Closed
briancroom opened this issue Nov 4, 2024 · 0 comments · Fixed by #806
Closed

Crash when a call to confirmation(expectedCount: 1...) { ... } fails #805

briancroom opened this issue Nov 4, 2024 · 0 comments · Fixed by #806
Assignees
Labels
bug 🪲 Something isn't working
Milestone

Comments

@briancroom
Copy link
Contributor

Description

I'm seeing a crash during issue stringification when running a test which fails due to a particular range-based confirmation failing.

Expected behavior

Expected an ordinary test failure, not a crash.

Actual behavior

A crash is occurring inside Issue.Kind.description.getter, specifically, at Issue.swift:203 in my checkout.

Steps to reproduce

Run the following test:

@Test func confirmedTooFewTimes() async {
  await confirmation(expectedCount: 1...) { (thingHappened) async in }
}

swift-testing version/commit hash

759ce02

Swift & OS version (output of swift --version ; uname -a)

No response

@briancroom briancroom added the bug 🪲 Something isn't working label Nov 4, 2024
grynspan added a commit that referenced this issue Nov 4, 2024
I was using `relative(to:)` to convert any arbitrary `RangeExpression` to one
with an upper and lower bound, but that function may produce invalid ranges for
expressions like `1...` that cause crashes.

This PR switches to a different, somewhat sillier implementation that should not
run into this issue.

Resolves #805.
@grynspan grynspan added this to the Swift 6.1 milestone Nov 4, 2024
@grynspan grynspan self-assigned this Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants