swiftlang / swift-testing

A modern, expressive testing package for Swift
Apache License 2.0
1.81k stars 77 forks source link

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

Closed briancroom closed 2 weeks ago

briancroom commented 2 weeks ago

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

759ce021552dc3939255f4cede093605404b58a8

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

No response