swiftlang / swift-testing

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

Fix a crash when describing a confirmation failure with a range. #806

Closed grynspan closed 2 weeks ago

grynspan commented 2 weeks ago

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. Resolves rdar://139222774.

Checklist:

grynspan commented 2 weeks ago

@swift-ci test