swiftlang / swift-testing

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

Fix how we check if a range expression covers one value. #815

Closed grynspan closed 1 week ago

grynspan commented 1 week ago

My previous fix, #806, had the wrong logic to determine if a confirmation's expected count as-a-RangeExpression had exactly one value, so we were printing sub-optimal messages on test failures. Specifically, this:

await confirmation(expectedCount: 1) { // transformed to 1...1
  // fail to confirm
}

Would report "1...1 time(s)" instead of "1 time".

Checklist:

grynspan commented 1 week ago

@swift-ci test