Skip to content

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

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
Nov 11, 2024

Conversation

grynspan
Copy link
Contributor

@grynspan grynspan commented Nov 9, 2024

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:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

My previous fix, #, 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:

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

Would report "1...1 time(s)" instead of "1 time".
@grynspan grynspan added bug 🪲 Something isn't working issue-handling Related to Issue handling within the testing library labels Nov 9, 2024
@grynspan grynspan added this to the Swift 6.1 milestone Nov 9, 2024
@grynspan grynspan self-assigned this Nov 9, 2024
@grynspan
Copy link
Contributor Author

grynspan commented Nov 9, 2024

@swift-ci test

@grynspan grynspan merged commit 1e65cf1 into main Nov 11, 2024
3 checks passed
@grynspan grynspan deleted the jgrynspan/lower-bound-range-description branch November 11, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working issue-handling Related to Issue handling within the testing library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants